您好,登錄后才能下訂單哦!
本篇內容介紹了“MySQL入門安裝方式”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
安裝mysql
1)rpm安裝mysql5.7
mysql-community-devel-5.7.12-1.el6.x86_64.rpm
mysql-community-libs-5.7.12-1.el6.x86_64.rpm
mysql-community-test-5.7.12-1.el6.x86_64.rpm
mysql-community-client-5.7.12-1.el6.x86_64.rpm
mysql-community-common-5.7.12-1.el6.x86_64.rpm
mysql-community-server-5.7.12-1.el6.x86_64.rpm
如果有沖突的安裝,先卸載,如:
rpm -e mysql-libs-5.1.66-2.el6_3.x86_64 --nodeps
2)啟動mysql
service mysqld start
3)修改mysql 的root用戶密碼
如果在/etc/my.cnf修改了socket文件位置,則也應該同時修改[mysql]的socket文件位置;
#mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
#mysql -u root mysql
//mysql5.6
// mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
//mysql5.7
mysql> UPDATE user SET authentication_string=PASSWORD('aaa123') where USER='root';
//使用desc user查看表字段描述
mysql> FLUSH PRIVILEGES;
mysql> quit
重新執行:
Mysql>SET PASSWORD = PASSWORD('123456');
或者
Mysql>alter user root@localhost identified by ‘aaAA1234!@#$’;
*rpm安裝,basedir為/usr
4)root用戶登錄mysql
[root@vm1 ~]# mysql -uroot -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.12 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>
“MySQL入門安裝方式”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。