1. Install client and server side
Verify that MySQL is installed:
?
12 |
yum list installed mysql* rpm -qa | grep mysql* |
To see if you have an installation package:
?
To install the MySQL client:
?
To install the MySQL server side:
?
12 |
yum install mysql-server yum install mysql-devel |
2. Start and stop settings
Database Character Set settings
MySQL config file/etc/my.cnf add Default-character-set=utf8
To start the MySQL service:
?
or/etc/init.d/mysqld start.
Set boot up:
?
See if the boot setting is successful
?
1 |
chkconfig --list | grep mysql* |
Mysqld 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
To stop the MySQL service:
?
3, login and forget to change the password
To create a root administrator:
?
1 |
mysqladmin -u root password 666666 |
Login:
Mysql-u root-p
If you forget your password, execute the following code
?
123456 |
service mysqld stop mysqld_safe --user=root --skip-grant-tables mysql -u root use mysql update user set password = password ( "666666" ) where user = "root" ; flush privileges ; |
4. Allow Remote access settings
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".
?
12 |
use mysql; UPDATE user SET `Host` = ‘%‘ WHERE ` User ` = ‘root‘ LIMIT 1; |
% means all IP access is allowed
5. Several important directories of MySQL
(a) Database directory
/var/lib/mysql/
(b) configuration files
/usr/share/mysql (mysql.server command and configuration file)
(c) Related orders
/usr/bin (Mysqladmin mysqldump and other commands)
(d) Startup scripts
/etc/rc.d/init.d/(startup script file for MySQL directory)
Install MySQL with yum under Linux