国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

Centos 7 解壓安裝mysql5.7

nicercode / 2855人閱讀

摘要:之前在各大論壇上看到有很多相關(guān)介紹,但是總覺得自己安裝的時(shí)候有些問題,所以這一篇借鑒博客園大大的橙子,但是,他的文章中安裝過程中有有點(diǎn)問題,所以在其基礎(chǔ)上進(jìn)行了修修補(bǔ)補(bǔ),所以目前本人經(jīng)過多次裸機(jī)安裝,親測(cè)正常。

之前在各大論壇上看到有很多相關(guān)介紹,但是總覺得自己安裝的時(shí)候有些問題,所以這一篇借鑒博客園-大大的橙子,但是,他的文章中安裝過程中有有點(diǎn)問題,所以在其基礎(chǔ)上進(jìn)行了修修補(bǔ)補(bǔ),所以目前本人經(jīng)過多次裸機(jī)安裝,親測(cè)正常。

卸載系統(tǒng)自帶的Mariadb

[root@aliyun ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.44-2.el7.centos.x86_64
[root@aliyun ~]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64
刪除etc目錄下的my.cnf文件
[root@aliyun ~]# rm /etc/my.cnf
rm: cannot remove ?etc/my.cnf? No such file or directory

檢查mysql是否存在

[root@aliyun ~]# rpm -qa | grep mysql
[root@aliyun ~]# 

安裝必要軟件

[root@aliyun ~]# yum install -y libaio

檢查mysql組和用戶是否存在,如無創(chuàng)建

[root@aliyun ~]# cat /etc/group | grep mysql 
[root@aliyun ~]#  cat /etc/passwd | grep mysql

創(chuàng)建mysql用戶組

[root@aliyun ~]# groupadd mysql

創(chuàng)建一個(gè)用戶名為mysql的用戶并加入mysql用戶組

[root@aliyun ~]# useradd -g mysql mysql

制定password 為111111

[root@aliyun ~]# passwd mysql
Changing password for user mysql.
New password: 
BAD PASSWORD: The password is a palindrome
Retype new password: 
passwd: all authentication tokens updated successfully.

由于我的/usr/local空間不足,所以我安裝到/var

[root@aliyun var]# tar -zxvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz 
[root@aliyun var]# mv mysql-5.7.18-linux-glibc2.5-x86_64/ mysql57

更改所屬的組和用戶

[root@aliyun var]# chown -R mysql mysql57/
[root@aliyun var]# chgrp -R mysql mysql57/
[root@aliyun var]# cd mysql57/

[root@aliyun mysql57]# mkdir data

[root@aliyun mysql57]# chown -R mysql:mysql data

配置my.cnf

[mysql]
# 設(shè)置mysql客戶端默認(rèn)字符集
default-character-set=utf8 
[mysqld]
skip-name-resolve
#設(shè)置3306端口
port = 3306 
# 設(shè)置mysql的安裝目錄
basedir=/var/mysql57
# 設(shè)置mysql數(shù)據(jù)庫的數(shù)據(jù)的存放目錄
datadir=/var/mysql57/data
# 允許最大連接數(shù)
max_connections=200
# 服務(wù)端使用的字符集默認(rèn)為8比特編碼的latin1字符集
character-set-server=utf8
# 創(chuàng)建新表時(shí)將使用的默認(rèn)存儲(chǔ)引擎
default-storage-engine=INNODB 
lower_case_table_names=1
max_allowed_packet=16M

開始初始化安裝,注意里面的數(shù)據(jù)庫密碼,請(qǐng)暫時(shí)先保存下來,是初始化密碼,登陸后再修改

shell> bin/mysqld --initialize --user=mysql --basedir=/var/mysql57/ --datadir=/var/mysql57/data/
2018-01-31T14:15:21.160016Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-01-31T14:15:25.102080Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-01-31T14:15:25.537811Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-01-31T14:15:25.646880Z 0 [Warning] Failed to setup SSL
2018-01-31T14:15:25.716100Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key
2018-01-31T18:14:25.716295Z 1 [Warning] A temporary password is generated for root@localhost: rq/Dldw^lkdfd

[root@aliyun mysql57]# cp ./support-files/mysql.server /etc/init.d/mysqld
[root@aliyun mysql57]# chown 777 /etc/my.cnf 
[root@aliyun mysql57]# chmod +x /etc/init.d/mysqld

[root@aliyun mysql57]# /etc/init.d/mysqld restart
Shutting down MySQL.. SUCCESS! 
Starting MySQL. SUCCESS! 

設(shè)置開機(jī)啟動(dòng)

[root@aliyun mysql57]# chkconfig --level 35 mysqld on
[root@aliyun mysql57]# chkconfig --list mysqld

[root@aliyun mysql57]# chmod +x /etc/rc.d/init.d/mysqld
[root@aliyun mysql57]# chkconfig --add mysqld
[root@aliyun mysql57]# chkconfig --list mysqld
[root@aliyun mysql57]# service mysqld status
 SUCCESS! MySQL running (4475)

設(shè)置/etc/profile環(huán)境 在尾部添加

export PATH=$PATH:/var/mysql57/bin

執(zhí)行source 使配置文件生效

[root@aliyun mysql57]# source /etc/profile

使用初始密碼,進(jìn)行連接數(shù)據(jù)庫

[root@aliyun bin]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 5
Server version: 5.7.18

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type "help;" or "h" for help. Type "c" to clear the current input statement.
#修改密碼為 111111
mysql> set PASSWORD = PASSWORD("111111");
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

#添加遠(yuǎn)程訪問權(quán)限
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> update user set host="%" where user="root";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select host,user from user;
+-----------+-----------+
| host      | user      |
+-----------+-----------+
| %         | root      |
| localhost | mysql.sys |
+-----------+-----------+
rows in set (0.00 sec)


create user "xxx"@"%" identified by "123";  這里 @‘%’ 表示在任何主機(jī)都可以登錄

重啟生效

[root@aliyun bin]# /etc/init.d/mysqld restart 
Shutting down MySQL.. SUCCESS! 
Starting MySQL. SUCCESS! 

設(shè)置任何目錄下都可以使用mysql命令

ln -s /var/mysql57/bin/mysql   /usr/bin/mysql

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://m.specialneedsforspecialkids.com/yun/8019.html

相關(guān)文章

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<