中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

mysql5.7.17 64位rhel6.5下安裝

發布時間:2020-08-12 22:39:34 來源:ITPUB博客 閱讀:177 作者:zuoluo2003 欄目:MySQL數據庫
安裝環境:
rhel6.5_64
MySQL Community Server 5.7.17 64位


下載yum安裝源文件:
http://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm


安裝下載的mysql57-community-release-el6-9.noarch.rpm


[root@rhel-mysql ~]# rpm -Uvh mysql57-community-release-el6-9.noarch.rpm
Preparing...                ########################################### [100%]
        package mysql57-community-release-el6-9.noarch is already installed


運行yum安裝mysql


[root@rhel-mysql ~]# yum install mysql-server


安裝完畢后,啟動mysql
[root@rhel-mysql ~]# service mysqld start
Initializing MySQL database:                               [  OK  ]  --第一次start會出現
Installing validate password plugin:                       [  OK  ]  --第一次start會出現
Starting mysqld:                                           [  OK  ]


得到初始化root密碼
[root@rhel-mysql ~]# grep "password" /var/log/mysqld.log
2016-12-13T15:52:48.468591Z 1 [Note] A temporary password is generated for root@localhost: Tyi>x<a-v3*C
2016-12-13T15:52:53.978420Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.8rIs89.sql' started.
2016-12-13T15:52:53.990711Z 0 [Note] Execution of init_file '/var/lib/mysql/install-validate-password-plugin.8rIs89.sql' ended.
2016-12-13T15:52:55.871356Z 0 [Note] Shutting down plugin 'sha256_password'
2016-12-13T15:52:55.871365Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-12-13T15:52:57.329377Z 3 [Note] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost' (using password: NO)


在my.cnf中加入validate_password_policy=0
[root@rhel-mysql ~]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
validate_password_policy=0


重啟mysql使my.cnf生效


[root@rhel-mysql ~]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]


運行 mysql_secure_installation,修改root密碼,然后全部默認回車


[root@rhel-mysql ~]# mysql_secure_installation


Securing the MySQL server deployment.


Enter password for user root: 
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.


Estimated strength of the password: 50 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : 


 ... skipping.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.


Remove anonymous users? (Press y|Y for Yes, any other key for No) : 


 ... skipping.




Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.


Disallow root login remotely? (Press y|Y for Yes, any other key for No) : 
Success.


By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.




Remove test database and access to it? (Press y|Y for Yes, any other key for No) : 


 ... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.


Reload privilege tables now? (Press y|Y for Yes, any other key for No) : 
Success.


All done! 


用新root密碼登錄數據庫
[root@rhel-mysql ~]# mysql -uroot -p11111111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.17 MySQL Community Server (GPL)


Copyright (c) 2000, 2016, 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.


mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)


root用戶擁有遠程登陸的權限


mysql> grant all privileges on *.* to 'root'@'%' identified by '11111111' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)


創建數據庫 create datasase zhangsan;


mysql> create database zhangsan;
Query OK, 1 row affected (0.00 sec)


創建用戶
mysql> CREATE USER 'hug'@'%' IDENTIFIED BY '12345678';
Query OK, 0 rows affected (0.01 sec)


為新用戶是授權
mysql> grant all privileges on zhangsan.* to hug;
Query OK, 0 rows affected (0.00 sec)


至此,mysql 5.7.17 設置完畢
設置mysql自動啟動,默認安裝完畢后在3、4、5下是默認啟動的
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld          0:off   1:off   2:off   3:on    4:on    5:on    6:off


修改mysqld是否自啟動
[root@rhel-mysql ~]# chkconfig --level 345 mysqld off
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@rhel-mysql ~]# chkconfig --level 345 mysqld on
[root@rhel-mysql ~]# chkconfig --list mysqld
mysqld          0:off   1:off   2:off   3:on    4:on    5:on    6:off

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

巴林右旗| 松滋市| 安泽县| 十堰市| 抚宁县| 徐水县| 惠州市| 高淳县| 台东县| 达州市| 五常市| 绵阳市| 贵南县| 安图县| 枣庄市| 波密县| 金山区| 东兴市| 湛江市| 尚义县| 阿拉善右旗| 海原县| 屏东县| 达拉特旗| 淮安市| 遂川县| 清镇市| 哈巴河县| 多伦县| 黑河市| 新疆| 根河市| 新源县| 乌鲁木齐县| 施秉县| 贵定县| 鄱阳县| 土默特左旗| 民丰县| 赣州市| 庆阳市|