MySQL dump restore in a remote machine with port 3307
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.
MySQL dump restore in a remote machine with port 3307
Hi All,
We have Mysql installed with port 3307. So we need to specify the sock file location using -S option to login in MySQL. I need help to restore MySQL dump into a remote machine. I want to know how can I specify the sock file while restoring the dump in a remote machine
Server 1: 192.168.1.2 ( will access the server using MySQL client )
Server 2: 192.168.1.3 ( MySQL DB) Port 3307
Dump backup is in 192.168.1.2 machine. I need to execute command in 192.168.1.2 to restore the dump in 192.168.1.3. Since MySQL in 192.168.1.3 is using 3307 I am not able to connect using the following command
mysql -h 192.168.1.3 -u root -p
It says cannot connect to 192.168.1.3. If there is an option to specify the sock while connecting remotely it would be helpful for me
Note: I do have port 22 open in 192.168.1.3 for 192.168.1.2. Only port 3307 is opened in 192.168.1.3 for 192.168.1.2
It did not work either. Is there any specific command to provide MySQL user only to restore dumps. I do not want to give grant all privileges. Instead I would like to give only restore access only. If I give it will work I think. My requirement is, the client should access the MySQL server every month end to drop the existing db, create the db and restore the dump thats all, other than this client should not have the rights to perform any other things in server side
grant CREATE, DROP on db.* to root@192.168.1.2 identified by 'password';
connect mysql server using mysql -h IP -P 3307 -u root -ppassword
I am able to connect now. Will check and update whether I can restore database. Can you provide with some script to restore mysql dump in remote machine based on date. I have script for restoring databases based on date on same pc.
I have a MySQL dump in 192.168.1.2. I want to import that dump into 192.168.1.3 database every month end once just to check whether the exported dump is able to restore properly. I am automating this as there are many servers which I need to do this. MySQL dump is taken on date basis i.e mysqltest_20120910.sql It will be like this. In script I do the following
1. Moving to the dir of dump location
2. Copying the dump from the source machine
3. Calling the MySQL restore script to restore the Database and send mail whether its success or failure using mutt
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.