1. Installation
See if you have installed:
Yum List installed mysql*
Rpm-qa | grep mysql*
To see if there are any installation packages:
Yum List mysql*
To install the MySQL client:
Yum install MySQL
To install the MySQL server side:
Yum Install Mysql-server
Yum Install Mysql-devel
2. Start && Stop
Database Character Set settings
MySQL config file/etc/my.cnf add Default-character-set=utf8
To start the MySQL service:
Service mysqld start or/etc/init.d/mysqld start
Boot start:
Chkconfig-add mysqld, check if boot boot settings are successful chkconfig--list | grep mysql*
Mysqld 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
Stop it:
Service Mysqld Stop
Ps:
MySQL Unrecognized service problem solving
After installing MySQL with Yum installed under CentOS, it was found that service mysqld start could not be turned on
appear mysqld:unrecognized service, online others said with/etc/rc.d/init.d/mysqld start, still can't solve.
Enter rpm-q MySQL query under terminal to find that Mysql-server is not installed
Enter the Yum install mysql-server immediately under terminal
Install the server side of MySQL, and then enter the service mysqld restart
Solve the problem successfully.
The following features have not been validated. Not used for the time being
2. Login
To create a root administrator:
Mysqladmin-u Root Password 123456
Login:
Mysql-u Root-p Enter the password.
Forgot Password:
Service Mysqld Stop
Mysqld_safe--user=root--skip-grant-tables
Mysql-u Root
Use MySQL
Update user set Password=password ("New_pass") where user= "root";
Flush privileges;
3. Remote Access
Port number for open firewall
MySQL Add permission: The user table in the MySQL library has a new record of "%" and the user is "root".
4. Several important directories of Linux MySQL
Database directory
/var/lib/mysql/
Configuration file
/usr/share/mysql (mysql.server command and configuration file)
Related commands
/usr/bin (Mysqladmin mysqldump and other commands)
Startup scripts
/etc/rc.d/init.d/(startup script file for MySQL directory)
Install MySQL with Yum under Linux