1. Change the remote root password
Mysqladmin-h ip-uroot-p123456 Password Password
If ' Access denied for user ' root ' @ ' IP ' (using Password:yes) appears
The remote host does not allow logins other than localhost, so the permissions are insufficient.
It's time to take a look under root host permissions
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/3A/wKiom1TLPn_ArjfRAAEoYcU2fPQ404.jpg "title=" QQ picture 20150130161732.jpg "alt=" Wkiom1tlpn_arjfraaeoycu2fpq404.jpg "/>
You will see that the host only allows native logons, does not allow remote host logins,
This is the time to modify permissions,
Show grants for ' root ' @ '% ';
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/38/wKioL1TLP8fTGiCTAAEp3eGtJJc383.jpg "title=" QQ picture 20150130161923.jpg "alt=" Wkiol1tlp8ftgictaaep3egtjjc383.jpg "/>
You can see that root is now more than just on this machine.
Then root telnet on the other host
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/3B/wKiom1TLP3_gzIvGAAGfpAl5qTY360.jpg "title=" QQ picture 20150130162209.jpg "alt=" Wkiom1tlp3_gzivgaagfpal5qty360.jpg "/>
Then the remote host password is modified
Mysqladmin-h ip-uroot-p123456 Password Password to modify the remote root login password
and the password for the Telnet host is remote root instead of the remote host you want to log in to its own password, which is not the same.
I didn't get it straight from the beginning.
6.ps aux |grep mysqld
You can see where the file runs and where the data is located 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/59/3B/ Wkiom1tlqdrivuhtaagvzuamfhq647.jpg "title=" qq picture 20150130163200.jpg "alt=" Wkiom1tlqdrivuhtaagvzuamfhq647.jpg "/>
7. Delete User permissions on the database
Revoke all on user. * from ' user ' @ '% ' identified by ' password ';
8. Remote Host Backup Database
Mysqldump-h 192.168.121.13-uroot-pyzg1314520 Test>test.sql (to have test database)
Recovery
Mysqldump-h 192.168.121.13-uroot-pyzg1314520 Test<test.sql
9. Give user permissions
Grant all on user. * to ' user ' @ '% ' identified by ' password ';
10. Enter Information_schemato see all database sizes
Use INFORMATION_SCHEMA;
Select Concat (Round (sum (data_length/1024/1024), 2), ' MB ') as data from tables;
11. View the specified database size
Use INFORMATION_SCHEMA;
Select Concat (Round (sum (data_length/1024/1024), 2), ' MB ') as data from tables where table_schema= ' database name ';
12. View the size of a table in a specified database
Use INFORMATION_SCHEMA;
Select Concat (Round (sum (data_length/1024/1024), 2), ' MB ') as data from tables where table_schema= ' home ' and Table_name= ' Table name ';
MySQL telnet password