Tuesday, September 13, 2016

[mysql] How to install mysql in centos

mysql CENTOS 7 installation

安裝 MySQL Repository:

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

安裝 MySQL Server, MySQL client 已經包括在 server 套件內:

# yum install mysql-community-server

開機自動啟動 MySQL

# /usr/bin/systemctl enable mysqld

啟動 MySQL

# /usr/bin/systemctl start mysqld

MySQL 預設為空密碼, 執行以下指令修改:

# /usr/bin/mysql_secure_installation




to enter client

$ mysql -uroot