新聞中心
阿里云安裝配置mysql
安裝的mysql版本是8.0的,一些安裝細(xì)節(jié)與以前的版本不一樣
創(chuàng)新互聯(lián)主營(yíng)察布查爾錫伯網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,重慶App定制開(kāi)發(fā),察布查爾錫伯h5成都微信小程序搭建,察布查爾錫伯網(wǎng)站營(yíng)銷(xiāo)推廣歡迎察布查爾錫伯等地區(qū)企業(yè)咨詢(xún)
啟動(dòng)mysql命令: service mysqld start
關(guān)于如何連接阿里云服務(wù)器上的MySQL數(shù)據(jù)庫(kù)的解答
用 SSH客戶端登錄上以后
首先啟動(dòng)數(shù)據(jù)庫(kù):
[root@iZm5ec880z2rorZ ~]#?service mysqld start
可以輸入一下加粗命令:
[root@iZm5ec880z2rorZ ~]# ?mysql -u root -p?
Enter password: (輸入你的數(shù)據(jù)庫(kù)密碼)
Welcome to the MySQL monitor. ?Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.73-log MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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?use mysql
Database changedmysql?GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'ldyu123' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql?commit;
Query OK, 0 rows affected (0.00 sec)
mysql?flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql ?exit;
退出后,輸入下邊的命令:
[root@iZm5ec880z2rorZ ~]#?service mysqld restart
Shutting down MySQL... ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [ ?OK ?]
Starting MySQL. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[ ?OK ?]
請(qǐng)教阿里云主機(jī)的mysql停止和啟動(dòng)的命令是啥linux
阿里云ECS云服務(wù)器 --(ubunto)
Bitvise SSH --和阿里云通訊,免費(fèi)的,從putty主頁(yè)上下載的
Notepadd++ --免費(fèi)的文件編輯
方法/步驟
下載免費(fèi)的Bitvise用來(lái)和阿里云通訊。
根據(jù)阿里云的ip地址和賬戶信息設(shè)置SSH鏈接。
點(diǎn)擊login,同時(shí)打開(kāi)命令窗口和SFTP窗口(類(lèi)似ftp那樣的下載上傳)。
找到服務(wù)器上的位置/etc/my.cnf,并下載一份備份在本地(后面還用,留一份原版的不要?jiǎng)樱?/p>
用Notepadd++打開(kāi)my.cnf文件,在[mysqld]的段中加上一句:skip-grant-tables 例如: [mysqld] datadir=/var/lib/mysql skip-grant-tables 保存
將修改過(guò)的my.cnf上傳到阿里云服務(wù)器上原來(lái)的位置覆蓋舊的文件。
通過(guò)命令窗口,重新啟動(dòng)mysql # /etc/init.d/mysql restart
成功后,窗口反饋:
Stopping MySQL: [ OK ] Starting MySQL: [ OK ]
接下來(lái),還是在命令窗口,進(jìn)入mysql;輸入
mysql USE mysql ;
mysql UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ;
完成
退出mysql。
命令窗口 mysql quit 回車(chē)
7
將最初備份的原始my.cnf重新上傳并覆蓋服務(wù)器上的文件。/etc/my.cnf (skip-grant-tables刪除 )最后重新啟動(dòng)mysqld # /etc/init.d/mysqld restart
輸入mysql -u root -p就會(huì)提示輸入新密碼,輸入剛才設(shè)置的秘密就可以進(jìn)去,說(shuō)明設(shè)置成功。
分享文章:阿里云怎么啟動(dòng)mysql 阿里云服務(wù)器安裝mysql57
網(wǎng)頁(yè)鏈接:http://fisionsoft.com.cn/article/doessid.html