Re: [PHP-DB] Using PHP to import a DB
On 2005-11-06, Todd Cary [EMAIL PROTECTED] wrote: system(mysql -u user -p db /tmp/mydb); With the -p switch, the user is asked for the password. How does that happen with the system command? Don't leave a space between -p and the password mysql -u user -pyourpassword -h somehost db /tmp/mydb -- Met vriendelijke groeten, Tim Van Wassenhove http://timvw.madoka.be -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] OT BibX mysql, and php
Hello, apologies if I am OT. I would like to know if anybody has developed a mysql+php BibTeX bibliography management systems/web interface. I have just seen http://www.rennes.supelec.fr/ren/perso/etotel/PhpBibtexDbMng/, and would like to know whether there is anything else. If you know any and its whareabouts, pls. let me know. Thanks a lot, regards mario -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Using PHP to import a DB
Robert - I installed phpmyadmin on the shared server, however I am not sure of the command to run the sql file, mybackup.sql, that was created on the dedicated server with mysqldump. The docs as best as I can read them indicate that all I need to type into the Run SQL query text box is the name of the file (/tmp/mybackup.sql), however that produces an error. Maybe the problem is that I FTP'd the file to the shared server and it should be on my local computer?? What have I overlooked? Todd Robbert van Andel wrote: You could run a system command from the web browser to import the text file. If you have access to PHPmyAdmin, you could use it to then import the file. Or finally, you should be able to read the contents of the file into a variable (if it's small enough) and then run the query using mysql_query. My personal preference is phpmyadmin. It's a very good database interface and can be retrieved from http://www.phpmyadmin.net/home_page/ Robbert van Andel -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Saturday, November 05, 2005 4:02 PM To: php-db@lists.php.net Cc: Chris Herron Subject: [PHP-DB] Using PHP to import a DB My client switched from a dedicated server to a shared server, so I cannot use the command line to import a DB that was produced with mysqldump. Can I duplicate mysql -u user -p db /tmp/mydb with php? Any suggestions are greatly appreciated Todd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Using PHP to import a DB
Robert - I used the backup file on my desktop computer and the browse button. After the upload was over, I got this message: Your SQL query has been executed successfully: The content of your file has been inserted. (sfyc_data_20051105.sql: 1 Instructions) However the tables were not created in the DB. I must be missing something simple here! A sample of the backup file is as follows: CREATE TABLE ACCESS ( AC_REF int(11) NOT NULL auto_increment, AC_MEMBER_NUM varchar(10) default NULL, AC_TYPE varchar(15) default NULL, AC_CHANGETIME timestamp(14) NOT NULL, PRIMARY KEY (AC_REF) ) TYPE=MyISAM; -- -- Dumping data for table 'ACCESS' -- INSERT INTO ACCESS VALUES (2230,'441','VIEWMEM',2004052332); Todd Robbert van Andel wrote: You could run a system command from the web browser to import the text file. If you have access to PHPmyAdmin, you could use it to then import the file. Or finally, you should be able to read the contents of the file into a variable (if it's small enough) and then run the query using mysql_query. My personal preference is phpmyadmin. It's a very good database interface and can be retrieved from http://www.phpmyadmin.net/home_page/ Robbert van Andel -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Saturday, November 05, 2005 4:02 PM To: php-db@lists.php.net Cc: Chris Herron Subject: [PHP-DB] Using PHP to import a DB My client switched from a dedicated server to a shared server, so I cannot use the command line to import a DB that was produced with mysqldump. Can I duplicate mysql -u user -p db /tmp/mydb with php? Any suggestions are greatly appreciated Todd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Using PHP to import a DB
Yes, this is an upload of a local file. I'm not sure if there is a way to run the sql command inside the file if it's sitting on the server. Keep in mind that you may run into size upload restrictions (i.e. files larger than 2 megs, or whatever your webhost has set it to). If that's the case, you can separate out the sql commands from the file into separate files. -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Sunday, November 06, 2005 8:43 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] Using PHP to import a DB Robert - I installed phpmyadmin on the shared server, however I am not sure of the command to run the sql file, mybackup.sql, that was created on the dedicated server with mysqldump. The docs as best as I can read them indicate that all I need to type into the Run SQL query text box is the name of the file (/tmp/mybackup.sql), however that produces an error. Maybe the problem is that I FTP'd the file to the shared server and it should be on my local computer?? What have I overlooked? Todd Robbert van Andel wrote: You could run a system command from the web browser to import the text file. If you have access to PHPmyAdmin, you could use it to then import the file. Or finally, you should be able to read the contents of the file into a variable (if it's small enough) and then run the query using mysql_query. My personal preference is phpmyadmin. It's a very good database interface and can be retrieved from http://www.phpmyadmin.net/home_page/ Robbert van Andel -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Saturday, November 05, 2005 4:02 PM To: php-db@lists.php.net Cc: Chris Herron Subject: [PHP-DB] Using PHP to import a DB My client switched from a dedicated server to a shared server, so I cannot use the command line to import a DB that was produced with mysqldump. Can I duplicate mysql -u user -p db /tmp/mydb with php? Any suggestions are greatly appreciated Todd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Using PHP to import a DB
Do you have permission to create tables (I would assume so)? Can you run any successful queries (i.e. not using the file upload)? If so, you might need to check your configuration file, or you might have some file size limitations, as I mentioned in my previous email. -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Sunday, November 06, 2005 8:57 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] Using PHP to import a DB Robert - I used the backup file on my desktop computer and the browse button. After the upload was over, I got this message: Your SQL query has been executed successfully: The content of your file has been inserted. (sfyc_data_20051105.sql: 1 Instructions) However the tables were not created in the DB. I must be missing something simple here! A sample of the backup file is as follows: CREATE TABLE ACCESS ( AC_REF int(11) NOT NULL auto_increment, AC_MEMBER_NUM varchar(10) default NULL, AC_TYPE varchar(15) default NULL, AC_CHANGETIME timestamp(14) NOT NULL, PRIMARY KEY (AC_REF) ) TYPE=MyISAM; -- -- Dumping data for table 'ACCESS' -- INSERT INTO ACCESS VALUES (2230,'441','VIEWMEM',2004052332); Todd Robbert van Andel wrote: You could run a system command from the web browser to import the text file. If you have access to PHPmyAdmin, you could use it to then import the file. Or finally, you should be able to read the contents of the file into a variable (if it's small enough) and then run the query using mysql_query. My personal preference is phpmyadmin. It's a very good database interface and can be retrieved from http://www.phpmyadmin.net/home_page/ Robbert van Andel -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Saturday, November 05, 2005 4:02 PM To: php-db@lists.php.net Cc: Chris Herron Subject: [PHP-DB] Using PHP to import a DB My client switched from a dedicated server to a shared server, so I cannot use the command line to import a DB that was produced with mysqldump. Can I duplicate mysql -u user -p db /tmp/mydb with php? Any suggestions are greatly appreciated Todd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Using PHP to import a DB
Robert - I created and loaded the tables by brute force. That is, I took each of the CREATE TABLE statements from the mysqldump file and executed them in the phpmyadmin SQL query area and then did the same for the INSERT commands. Not what I am use too with a dedicated server though :-) !! I bet it is a filesize problem...I'll look into that. It appears that I'll have to use the DUMP or SELECT * INTO OUTFILE ... for each table for a backup. Not as convenient as the mysqldump command! Unless I can get the php system() to work. Many thanks for holding my hand during this learning process Todd Robbert van Andel wrote: Do you have permission to create tables (I would assume so)? Can you run any successful queries (i.e. not using the file upload)? If so, you might need to check your configuration file, or you might have some file size limitations, as I mentioned in my previous email. -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Sunday, November 06, 2005 8:57 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] Using PHP to import a DB Robert - I used the backup file on my desktop computer and the browse button. After the upload was over, I got this message: Your SQL query has been executed successfully: The content of your file has been inserted. (sfyc_data_20051105.sql: 1 Instructions) However the tables were not created in the DB. I must be missing something simple here! A sample of the backup file is as follows: CREATE TABLE ACCESS ( AC_REF int(11) NOT NULL auto_increment, AC_MEMBER_NUM varchar(10) default NULL, AC_TYPE varchar(15) default NULL, AC_CHANGETIME timestamp(14) NOT NULL, PRIMARY KEY (AC_REF) ) TYPE=MyISAM; -- -- Dumping data for table 'ACCESS' -- INSERT INTO ACCESS VALUES (2230,'441','VIEWMEM',2004052332); Todd Robbert van Andel wrote: You could run a system command from the web browser to import the text file. If you have access to PHPmyAdmin, you could use it to then import the file. Or finally, you should be able to read the contents of the file into a variable (if it's small enough) and then run the query using mysql_query. My personal preference is phpmyadmin. It's a very good database interface and can be retrieved from http://www.phpmyadmin.net/home_page/ Robbert van Andel -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Saturday, November 05, 2005 4:02 PM To: php-db@lists.php.net Cc: Chris Herron Subject: [PHP-DB] Using PHP to import a DB My client switched from a dedicated server to a shared server, so I cannot use the command line to import a DB that was produced with mysqldump. Can I duplicate mysql -u user -p db /tmp/mydb with php? Any suggestions are greatly appreciated Todd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php