Start
Mysqld
When you start MySQL on the command line, if you do not add "--console", the startup, shutdown information is not displayed in the interface, but is recorded in the installation directory of the data directory, the file name is generally hostname.err, through this file to view the MySQL console information.
Close
Mysqladmin-u Root shutdown
command line connection server
Mysql-h localhost-u root-proot (-p and password directly without spaces)
Or
Mysql-h localhost-u Root-p Enter
Follow the prompts and enter the password
Root
MySQL database user table host field
A localhost, a 127.0.0.1, a:: 1, in fact, these three are a meaning, are the local machine,: 1 is IPv6 address 127.0.0.1 abbreviation, that is, this machine.
The host column is the specified login IP, such as User=root host=192.168.1.1, which means that the root user can only access through 192.168.1.1 client, and% is a wildcard, if host=192.168.1.%, Then it means that as long as the IP is host=192.168.1. prefix client can be connected, then host=% said that all IP is authorized to connect, which is why when the remote connection is opened, most people directly changed the host to% because of the convenience.
telnet
Update user Set host = '% ' where user = ' root ' limit 1;
If you modify the table directly, you need to restart the service to take effect or flush privileges;
Authorization Mode remote login
Allow the root user to be used from any host, password: youpassword (your root password) to connect to the MySQL server:
# mysql-u Root-proot
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;
Allow the address 202.11.10.253 with root user, password dboomysql to connect all MySQL database, pay select,insert,update,delete permission.
# mysql-u Root-proot
Grant Select,insert,update,delete on * * to [e-mail protected] "202.11.10.253" identified by "Dboomysql";
Allow the address 202.11.10.253 with root user, password dboomysql to connect all MySQL database, pay all permissions.
# mysql-u Root-proot
Grant all on * * to [e-mail protected] "202.11.10.253" identified by "Dboomysql"
After the operation, remember to perform the following command refresh permissions
FLUSH Privileges
Change Password
Mysqladmin-u root-p [OldPassword] Password NewPassword
Note Oldpass (old password) optional, if the root default password is empty, you do not need to enter, if you need to change the old password, please note that the old password and-p do not have a space, otherwise will be error, the other password (function) and newpassword (new password) separated by a space
MySQL database Getting Started operation