Yum install MySQL
There are many ways to install MySQL, and now we are mainly talking about yum installing MySQL.
1. MySQL website
www.mysql.com to download the latest version
2.MySQL packages that need to be installed
MySQL-server Server
MySQL client
Mysql-devel Library file
3. Installing the MySQL database:
yum list|grep mysql # See if a MySQL package is installed rpm -qa |grep mysql-server #查看是否已安装mysql包 yum -y install mysql-server mysql mysql-devel # Yum install MySQL required package rpm -qa |grep mysql service mysqld start #启动服务, automatic initialization of service mysqld restart # Start again, initialization is complete
at this point, the default only Root user, and no password is required to initialize the password:
Mysqladmin-uroot password ' 123 ' #初始化密码
Log in to the MySQL database:
Mysql-uroot-p ' 123 '
To exit the database:
Mysql> exit or Mysql> quit
To add the MYSQLD service to boot:
Chkconfig mysqld on
To view the port status of MySQL:
[[email protected] ~]# netstat-lntup|grep mysqltcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2071/mysqld
Note: The default port for MySQL is 3306, and the default protocol is TCP
To view MySQL version information:
Rpm-qi Mysql-server
4. mysql Important configuration file
/ETC/MY.CNF #mysql配置文件保存位置
/var/lib/mysql/#mysql Database save data File location
Datadir=/var/lib/mysql The configuration file for the MySQL database default save location, which can be modified in the Vim Editor
/var/log/# default log save location
Mysqld.log # log File
This article is from the "Lanzhi" blog, make sure to keep this source http://7826443.blog.51cto.com/7816443/1706107
MySQL Database < two >