[root@vm_42_245_centos ~]# tar xf mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
[root@vm_42_245_centos ~]# ls
mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-5.7.17-1.el7.x86_64.rpm
mysql-community-common-5.7.17-1.el7.x86_64.rpm
mysql-community-devel-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm
mysql-community-libs-5.7.17-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm
mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm
mysql-community-server-5.7.17-1.el7.x86_64.rpm
mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm
mysql-community-test-5.7.17-1.el7.x86_64.rpm
[root@vm_42_245_centos ~]# rpm -qa |grep mariadb
mariadb-libs-5.5.50-1.el7_2.x86_64
[root@vm_42_245_centos ~]# rpm -e --nodeps mariadb-libs-5.5.50-1.el7_2.x86_64
[root@vm_42_245_centos ~]# useradd -s /sbin/nologin mysql
[root@vm_42_245_centos ~]# rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm
[root@vm_42_245_centos ~]# rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm
[root@vm_42_245_centos ~]# rpm -ivh mysql-community-devel-5.7.17-1.el7.x86_64.rpm
[root@vm_42_245_centos ~]# rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm
[root@vm_42_245_centos ~]# rpm -ivh mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm
[root@vm_42_245_centos ~]# yum -y install numactl-libs
[root@vm_42_245_centos ~]# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm
[root@vm_42_245_centos lib]# cd /usr/bin/
[root@vm_42_245_centos bin]# mysqld --initialize --user=mysql
[root@vm_42_245_centos bin]# systemctl start mysqld
[root@vm_42_245_centos bin]# cat /var/log/mysqld.log |grep pass
[root@vm_42_245_centos bin]# mysql_secure_installation
[root@vm_42_245_centos bin]# mysql -uroot -p
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.17 |
+-----------+
1 row in
set (0.00 sec)
預設只允許root帳戶在本地登入,如果要在其它機器上連線mysql,必須修改root允許遠端連線,或者新增乙個允許遠端連線的帳戶,為了安全起見,我新增乙個新的帳戶:
mysql> grant all privileges on *.* to 'username'@'%' identified by 'password' with grant option;修改/etc/my.cnf配置檔案,在[mysqld]下新增編碼配置,如下所示:
[mysqld]
character_set_server=utf8
init_connect='set names utf8'重新啟動mysql服務,檢視資料庫預設編碼如下所示:
mysql安裝完成!
rpm 方式安裝mysql
wget 解壓 tar xvf mysql 5.7.28 1.el7.x86 64.rpm bundle.tar 如下 檢視系統是否自帶mariadb rpm qa grep mariadb 將查出的mariadb進行解除安裝 rpm e nodeps mariadb libs 5.5.64 1.e...
RPM方式安裝MySQL
最近浪子嘗試使用mycat做mysql的讀寫分離和分表分庫,因此搭建了幾台虛擬機器來做操作.話不多說,我們現在centos7上安裝mysql.據說centos7上面直接用yum的方式安裝mysql會失敗,那麼我就直接使用手動的方式安裝.libsclientserver4個rpm包.安裝的mysql版...
通過rpm方式安裝Mysql
一般linux伺服器版都預設安裝有mysql,但是可能不是你要的版本,所以先解除安裝。rpm ev mysql 5.0.77 4.el5 4.2 如果存在依賴包就將依賴的包乙個乙個通過rpm ev解除安裝。然後安裝 rpm ivh mysql server community 5.1.49 1.rh...