关于本地mysql客户端如何连接阿里云服务器上的MySQL数据库
生活随笔
收集整理的這篇文章主要介紹了
关于本地mysql客户端如何连接阿里云服务器上的MySQL数据库
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
前言
用 SSH客戶端登錄上以后,自己想要在本地連接服務(wù)器上的mysql服務(wù)器。
解決方法
1、首先啟動(dòng)數(shù)據(jù)庫
[root@iZm5ec880z2rorZ ~]# service mysqld start 可以輸入一下加粗命令: [root@iZm5ec880z2rorZ ~]# mysql -u root -p Enter password: (輸入你的數(shù)據(jù)庫密碼) 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;2、退出后,輸入下邊的命令
[root@iZm5ec880z2rorZ ~]# service mysqld restart Shutting down MySQL... [ OK ] Starting MySQL. [ OK ]然后在本地輸入自己設(shè)置的密碼就可以連接上來了 。
總結(jié)
以上是生活随笔為你收集整理的关于本地mysql客户端如何连接阿里云服务器上的MySQL数据库的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: centos 上yum命令删除还原补救方
- 下一篇: MySQL数据库乱码 - Linux下乱