1. log on to MySQL-uroot-P.
2. MySQL cannot be accessed from the Internet in Linux
You have granted permissions in MySQL. It is still inaccessible on the Internet.
Problem:
CAT/etc/MySQL/My. conf
Find the following line
Bind-address = 127.0.0.1
For data security, MySQL is only waiting on 127.0.0.1 by default, and there is no comment in front, so it can only be accessed locally.
Solution:
Add a comment before bind-address to restart MySQL.
Step 2:
Mysql> use MySQL;
Mysql> Update user set host = '%' where user = 'root ';
Mysql> flush privileges;
Mysql> select 'host', 'user' from user where user = 'root ';
Use the following command to modify the settings! Restart MySQL
3.Database Export and Import
The following example shows how to export a MySQL database and often make a backup of data export. Putty logs on to the server and enters the directory of the database to be backed up. After the backup is complete, the database file will be saved in this directory. The operation steps on the command line are as follows:
(1 ).mysqldump -u username -p database_name > 20090708.sql
(2). Press ENTER
(3). Prompt to enter the password
(4) enter the password and press Enter.
Upload the MySQL database backup file (for example, the exported file 20090708. SQL) to your server, or directly download the database file to the new server through the wget command (mentioned above, run the following command:
(1 ).mysql -u username -p database_name < 20090708.sql
(2). Press ENTER
(3). Prompt to enter the password
(4) enter the password corresponding to the user name and press Enter.
Username, password, and database_name are the username, password, and Database Name of the MySQL database. The Bak. SQL file is the name of the backup file of the MySQL database. When importing data to a new server, the database name and user name must match the new one.