Mac connection occurs at mounting MariaDB Access denied for user 'root' @ 'localhost' (using password: YES).

Enter the command configure normal brew:

brew install mariadb

 

If the following prompt the installation was successful

 

A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
    mysql -uroot

To have launchd start mariadb at login:
  ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
Then to load mariadb now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
Or, if you don't want/need launchctl, you can just run:
  mysql.server start

Roughly meaning you can use the above command to set up since the launch of the service.

If you do not need from the start, you can use mysql.server start to start

I do not like from the start, so I used mysql.server start

➜  ~ mysql.server start
Starting MySQL
. SUCCESS! 
➜  ~ 

Tip follows, it indicates a successful launch! The following database operations begin

 

➜  ~ mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.0.21-MariaDB Homebrew

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye
➜  ~ 

At this point, MariaDB you can normally use.

MariaDB MySQL with them is the same with the same, I have not a lot of database operations, this time would like to put forward their own thing, might later encounter many pits, here to remind ourselves time to promptly recorded.

At last

 

➜  ~ mysql.server stop
Shutting down MySQL
.. SUCCESS! 
➜  ~ 

It says that under ideal conditions mysql start, do not go after start landing situation:

Error message is: Access denied for the User  'root' @ 'localhost'  (a using password: YES)

Solution:

The first step: Apple -> System Preferences -> MySQL , shut down mysql service

Step two:

Enter the terminal

Input (cd / usr / local / mysql / bin /) Enter

Input (sudo su) Enter to obtain administrator privileges

Input (./mysqld_safe --skip-grant-tables &) Enter to prohibit authentication mysql, mysql will automatically restart, mysql state preferences will become running

third step:

A new terminal window (cmd + T),

Enter the command (./mysql) Enter

Input command (flush privileges;) do not forget lost semicolon

Enter the command (set password for 'root' @ 'localhost' = password ( 'root');) password ( 'root') in the root password for the new, easily set up their own, do not forget to enter the semicolon

At this point, the password change successfully and is ready to sign up.

Published 172 original articles · won praise 45 · views 40000 +

Guess you like

Origin blog.csdn.net/fish_study_csdn/article/details/104220715