1. 程式人生 > >Linux下Mysql安裝(RPM安裝)

Linux下Mysql安裝(RPM安裝)

.cn num led com erro sql文件 官網 方法 l命令

1. 首先檢查機器裏是否已經存在MySQL

$ rpm -qa | grep mysql

2. 去官網下載相應的rpm包:https://dev.mysql.com/downloads/mysql/

mysql-community-common-5.7.19-1.el6.x86_64.rpm
mysql-community-client-5.7.19-1.el6.x86_64.rpm
mysql-community-server-5.7.19-1.el6.x86_64.rpm
mysql-community-libs-5.7.19-1.el6.x86_64.rpm

3. 上傳到/usr/local/mysql文件夾,進行安裝mysql

  按照以下順序進行安裝,因為它們之間存在依賴關系

#common --> libs --> clients --> server

rpm -ivh mysql-community-common-5.7.19-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.19-1.el6.x86_64.rpm
rpm -ivh mysql-community-clients-5.7.19-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.19-1.el6.x86_64.rpm

  如果不按照這樣的順序,將會出現如下錯誤:

# error: Failed dependencies: libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64 libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.19-1.el6.x86_64 libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.19-1
.el6.x86_64

  解決方法:

$ yum install -y numactl

4. 安裝好後,可以去檢查是否存在MySQL的配置文件或者MySQL的命令在/usr/bin下

#mysql配置文件
$ ls /etc/my.cnf

# mysql命令
$ cd /usr/bin/
$ ls | grep mysql
  
$ /etc/init.d/mysqld start
$ ps aux|grep mysqld

5.後續密碼等配置

  請參考:

Linux下Mysql安裝(RPM安裝)