阿里云服务器ubuntu 16.04 安装mysql
来源:互联网 发布:centos 6.7安装mysql 编辑:程序博客网 时间:2024/06/12 20:54
sudo apt-get update
sudo apt-get install mysql-server
sudo apt-get isntall mysql-client
sudo apt-get install libmysqlclient-dev
sudo netstat -tap | grep mysql
重启mysql
/etc/init.d/mysql restart
MySQL登录与退出:
登录Mysql:“输入mysql -u帐号 -p密码
mysql退出:mysql > exit;
以下是实例参考下:
登录Mysql:“输入mysql -uroot -p -P3306 -h127.0.0.1”
表示超级用户名root,密码稍后输入,端口号3306(不输入P默认为3306),
主机地址127.0.0.1(若使用本机作为主机,h默认127.0.0.1)
mysql退出三种方法:
mysql > exit;
mysql > quit;
mysql > \q;
默认是不能用客户端远程连接的,阿里云提供的help.docx里面做了设置说明,mysql密码默认存放在/alidata/account.log
首先登录: mysql -u root -h localhost -p
use mysql #打开mysql数据库
#将host设置为%表示任何ip都能连接mysql,当然您也可以将host指定为某个ip
update user set host='%' where user='root' and host='localhost';
flush privileges; #刷新权限表,使配置生效
然后我们就能远程连接我们的mysql了。
3、如果您想关闭远程连接,恢复mysql的默认设置(只能本地连接),您可以通过以下步骤操作:
use mysql #打开mysql数据库
#将host设置为localhost表示只能本地连接mysql
update user set host='localhost' where user='root';
flush privileges; #刷新权限表,使配置生效
备注:您也可以添加一个用户名为yuancheng,密码为123456,权限为%(表示任意ip都能连接)的远程连接用户。命令参考如下:
grant all on *.* to 'yuancheng'@'%' identified by '123456';
flush privileges;
#启动sudo service mysql start#停止sudo service mysql stop#服务状态sudo service mysql status
mysql 登录退出命令
- 阿里云服务器ubuntu 16.04 安装mysql
- 阿里云服务器Ubuntu安装mysql
- 阿里云服务器Ubuntu安装mysql
- Ubuntu阿里云服务器安装Mysql
- 游戏服务器开发--阿里云Ubuntu 安装mysql
- 阿里云服务器mysql安装
- 阿里云服务器安装mysql
- 阿里云服务器【ubuntu】安装jdk
- 阿里云服务器【ubuntu】Tomcat安装
- 阿里云服务器【ubuntu】安装jdk
- 阿里云服务器【ubuntu】Tomcat安装
- 阿里云服务器【ubuntu】安装jdk
- 阿里云服务器【ubuntu】安装hadoop
- 阿里云服务器Ubuntu安装jdk7
- 阿里云服务器Ubuntu安装jdk7
- 阿里云服务器Ubuntu安装tomcat
- 阿里云服务器Ubuntu安装jdk7
- 阿里云服务器安装配置mysql数据库
- 线程的同步互斥
- Spring AOP在鉴权和日志中的应用
- 二分法最简单最直观的核心代码
- VS Code前端必备插件
- 软件测试的方法一共有几种
- 阿里云服务器ubuntu 16.04 安装mysql
- linux之参数实用讲解
- 终极组件化框架项目方案详解
- codeforces刷题方法
- 命令ps查看当前系统的进程状态
- React基本使用(引用版)
- Linux命令(31)——find命令
- 命令netstat查看网络状态
- Ubuntu16.04LTS 下ros(kinetic)的arduino应用(二)