Cannot log in with created user in mysql

前端 未结 12 1757
小蘑菇
小蘑菇 2020-12-07 15:31

Using this command

GRANT ALL PRIVILEGES ON *.* to \'brian\'@\'%\' identified by \'password\';

I try to login with:

 mysql -         


        
12条回答
  •  無奈伤痛
    2020-12-07 16:12

    I had a similar problem attempting to connect to a Maria DB running on Ubuntu after upgrading to 17.04.

    The default was to listen only on localhost, 127.0.0.1.

    To make MySQL/Maria listen on all available ports and interfaces I needed to explicitly specify bind-address=0.0.0.0. I added this line to the end of the file /etc/mysql/my.cnf, i.e.

    ...
    [client-server]
    
    # Import all .cnf files from configuration directory
    
    !includedir /etc/mysql/conf.d/
    !includedir /etc/mysql/mariadb.conf.d/
    bind-address=0.0.0.0
    

    Then...

    sudo /etc/init.d/mysql restart 
    

提交回复
热议问题