预览加载中,请您耐心等待几秒...
1/3
2/3
3/3

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

Linuxmysql允许远程连接教程1、root用户登录到mysql数据库/usr/local/mysql/bin/mysql-uroot-p(输入密码进入mysql)2、进入mysql,输入如下命令usemysql;3、查看user表的情况SELECTHost,UserFROMuser;//指明主机名称,“%”表示匹配所有字符串4、UPDATEuserSETHost='%'WHEREUser='root'LIMIT1;5、输入如下命令让刚才设置的命令生效mysql>flushprivileges;QueryOK,0rowsaffected(0.00sec)注意在mysql命令行形式下一定要输入";"按照前面五个步骤完成之后,通过控制台输入[root@linux~]#mysql-hlocalhost-uroot-pEnterpassword:ERROR1045(28000):Accessdeniedforuser'root'@'localhost'(usingpassword:YES)不让这么连接数据库原因:是因为host对应的user字段是空的,我们需要将其改为root即可mysql>selecthost,userfromuser;+-----------+------+|host|user|+-----------+------+|%|root||127.0.0.1|root||linux|||linux|root||localhost||+-----------+------+5rowsinset(0.00sec)解决办法一:mysql>updateusersetuser='root'wherehost='localhost';QueryOK,1rowaffected(0.00sec)Rowsmatched:1Changed:1Warnings:0mysql>flushprivileges;QueryOK,0rowsaffected(0.00sec)解决办法二:将localhost改为本机的IP地址,则能够识别了[root@linux~]#mysql-h172.16.42.68-uroot-pEnterpassword:WelcometotheMySQLmonitor.Commandsendwith;or\g.YourMySQLconnectionidis157Serverversion:5.1.66SourcedistributionCopyright(c)2000,2012,Oracleand/oritsaffiliates.Allrightsreserved.OracleisaregisteredtrademarkofOracleCorporationand/oritsaffiliates.Othernamesmaybetrademarksoftheirrespectiveowners.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.看了“Linuxmysql允许远程连接教程”还想看:1.mysql怎么设置远程连接数据库2.linux下mysql允许外部远程访问配置3.Linux中的MySql数据库远程连接教程4.怎么解决mysql不允许远程连接的错误