Initialization
(1) Set password for root user (three ways):
SET PASSWORD for ' username ' @ ' host ' = PASSWORD (' Your_password ');
Update Mysql.user set Password=password (' Your_password ') where user= ' username ' and host= ' hostname or IP '
mysqladmin-uusernmae-hhostname_or_ip-p password ' new_password '
(2) Delete anonymous users:
DROP USER ' @ ' HOSTNAME '
The above steps can run the command; mysql_secure_installation
(3) It is recommended to turn off the host name inverse function;
Vim/etc/my.cnf
Skip-name-resolve
Find path:
/ETC/MY.CNF--/ETC/MYSQL/MY.CNF-$MYSQL _home/my.cnf-----default-extra-file=/path/to/somedir/my.cnf-- > ~/.my.cnf
The more the latter, the last effective
--defaults-extra-file=#: Additional read configuration file;
--defaults-file=#: Read only the configuration file specified here
Common options for MySQL client programs:
-u,-h,-p,--Database,--Port
Import Batch script: Log in to MySQL source/path/script.sql or MySQL </path/script.sql
MySQL single statement insert: MYSQL-E ' SQL statement '
This article is from the "Wang Liming" blog, make sure to keep this source http://afterdawn.blog.51cto.com/7503144/1925772
MySQL Learning Note (2-initialization)