#################设置mysql
登陆:
[root@typecodes ~]# mysql -u root -p
创建用户:
[root@typecodes ~]# insert into mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject)values('localhost','baochengwx',password('baochengwx'),'','','');
刷新权限:
[root@typecodes ~]# FLUSH PRIVILEGES;
创建数据库:
[root@typecodes ~]# create database companys;
分配数据库给用户
[root@typecodes ~]# grant all privileges on companys.* to companys identified by 'companys';
修改密码
UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
远程登陆
user表中 Host列 'localhost' 改成 '%' (也可以是固定ip、本地登陆localhost、%指不限登陆地址)