二進位方式安裝mysql-5.6.16

來源:互聯網
上載者:User

標籤:系統版本   use   group   版本   groupadd   ini   所有者   linux   client   

一、檢查系統版本
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)

 

二、添加使用者與組

# groupadd mysql
# useradd -g mysql mysql

 

三、安裝MySQL到/usr/local/mysql下

#cd /usr/local
#tar zxvf mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz
#mv mysql-5.6.16-linux-glibc2.5-x86_64/     mysql

 

四、修改mysql目錄的所有者和所屬組位mysql

# chown -R mysql:mysql  mysql/ .

 

五、初始化
#scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 初始化
#cp support-files/mysql.server /etc/init.d/mysqld 


六、修改設定檔
#cp /usr/local/mysql/my.cnf /etc/my.cnf
#vim /etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
server_id = 1
socket = /tmp/mysql.sock

[client]

socket = /tmp/mysql.sock


七、啟動mysql服務
#ln -s /usr/local/mysql/bin/mysql /usr/bin 軟連結
#service mysqld start


八、登陸mysql並且刪除空使用者
mysql> select user,host,password from mysql.user;
+------+-----------+----------+
| user | host | password |
+------+-----------+----------+
| root | localhost | |
| root | mysql | |
| root | 127.0.0.1 | |
| root | ::1 | |
| | localhost | |
| | mysql | |
+------+-----------+----------+
6 rows in set (0.00 sec)

mysql> UPDATE mysql.user set password = PASSWORD(‘gechong‘) WHERE user = ‘root‘;
mysql> DROP USER ‘‘@localhost;
mysql> FLUSH PRIVILEGES;

二進位方式安裝mysql-5.6.16

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.