Archive

Posts Tagged ‘mysql remote access’

Solved:mysql without access to remote hosts

August 23rd, 2010 Comments off

1.Firstly,find your mysql my.cnf configuration file:(mysql --help|grep "Default options are read" -1 #-1,show 1 line before and 1 line after the match line)
Default options are read from the following files in the given order:
/etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf
2.vim and 47gg to jump to the 47 line,comment away bind-address

3.log in mysql,and execute the following sql statement:
CREATE USER 'root'@'%';
GRANT ALL PRIVILEGES ON * . * TO 'root'@'%' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
SET PASSWORD FOR 'root'@'%' = PASSWORD( '******' )