Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408
Rep:
Recovering MySQL database
Hi,
I was trying to change the name of the database in my local computer to the same one in my public domain using phpmyadmin, but I got some error messages and after that I lost many tables in it. Fortunately, I have several back ups of my public database. I created a new database and then used source command to recover my website, but in my surprise at some point it gave me error 1064. I googled it and it said that:You will get a MySQL query syntax error number 1064 when you incorrectly use a reserved word in your query such as "when" or "order".
I have created that backup file from my public domain database using cpanel, which i guess uses mysqldump, but I don't know why I cannot recover it on my computer.
I was trying to change the name of the database in my local computer to the same one in my public domain using phpmyadmin, but I got some error messages and after that I lost many tables in it. Fortunately, I have several back ups of my public database. I created a new database and then used source command to recover my website, but in my surprise at some point it gave me error 1064. I googled it and it said that:You will get a MySQL query syntax error number 1064 when you incorrectly use a reserved word in your query such as "when" or "order".
I have created that backup file from my public domain database using cpanel, which i guess uses mysqldump, but I don't know why I cannot recover it on my computer.
Any idea how to do it?
Hi there,
Do you have command line access to the server ? This can help if you do...
Find your .sql backup file (I'm also assuming that cpanel used mysqldump and that you have a .sql file) and then you simply have to run this:
mysql < dbname.sql
You can also do this remotely provided you have access to the server where your backup is from your new one:
Can you read the dump file? It may be trying to create a database/table that already exists or it may not be using the database when it tries to create the tables. If you look at the first few lines of the dump file, it will probably tell you what it is trying to do. If you can't figure it out from that, post the first 20 lines or so of your dump file.
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408
Original Poster
Rep:
Actually it creates 5 tables. I guess inside the 6th table there are some weired characters that don't let me perform my query. The table is very big, that s why it s very hard to identify where the problem is coming from.
Well, if it creates 5 tables, then the problem is probably in the 5th table or the CREATE portion of the 6th table. Look at the 6th table's create and see if it doesn't have any strange problems, then look at the insert statements from the 5th table. You can run "select count(*) from table_5;" to see how many lines got inserted in that table to give you a place to start looking.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.