Installation:
Yum Install-y mysql-server
Use
- Restart : service mysqld Restart
The initial installation of the Mysql,root account has no password.
#进入控制台
mysql-u Root Welcome to the MySQL Monitor. show databases; +--------------------+| Database |+--------------------+| information_schema | | mysql | | performance_schema | | test
Set the password ( no need to restart the database to take effect ).
Configuration
MySQL config file is/etc/my.cnf
1. Coding
MySQL config file is/etc/my.cnf
Finally add the encoding configuration
[Mysql]default-character-set =utf8
The character encoding here must be consistent with the/usr/share/mysql/charsets/index.xml.
2. Remote connection Settings
Assign all permissions for all tables in all databases to the root user at all IP addresses.
Mysql> Grant all privileges on * * to [e-mail protected] '% ' identified by ' 123456 ';
If you are a new user and not root, create a new user first
Mysql>create user ' username ' @ '% ' identified by ' password ';
The remote connection is now available.
The MySQL installation configuration for CentOS uses