Linux Mysql server配置(笔记)
1.在Ubuntu下安装Mysqlclient和Mysqlserver
sudo apt-get install mysql-client sudo apt-get install mysql-server
2.安装之后修改root密码
$ mysqladmin -u root password your_new_passwd
3.连接Mysql,可以在-p之后紧跟root对应的密码,或-p按回车之后隐式输入密码
$mysql -u root -p
4.新建一个用户,需要用root连接Mysql,新建完用户记得刷新一下权限
mysql> use mysql; mysql> insert into user(Host,User,Password) values('localhost','name',password('123456')); mysql> flush privileges;
5.新建之后用该用户连接一次验证是否新建成功
6.给新建的用户添加对应的数据库和权限,"name@'%'"表示用户可以在任何主机登陆,即不限制其远程连接
mysql> create database newdb; mysql> grant all privileges on newdb.* to name@'%' identified by '123456'; mysql> flush privileges;7.在别的机器上测试远程连接发现连接不上,还要修改/etc/init.d/my.cnf文件,将以下一行注释掉
bind-adress = 127.0.0.1
8.连接成功
相关推荐
lpfvip00 2020-10-07
emmm00 2020-11-17
王艺强 2020-11-17
aydh 2020-11-12
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10
adsadadaddadasda 2020-09-08
疯狂老司机 2020-09-08
CoderToy 2020-11-16
ribavnu 2020-11-16