您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“MySQL入門安裝方式”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
安裝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文件位置,則也應(yīng)該同時修改[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
重新執(zhí)行:
Mysql>SET PASSWORD = PASSWORD('123456');
或者
Mysql>alter user root@localhost identified by ‘a(chǎn)aAA1234!@#$’;
*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入門安裝方式”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。