Mysql for Mac and mysql for Mac
1. Install mysql
2. Start the mysql service in preference settings
3. Open the terminal and enter mysql.
chenhong:~ chenhong$ mysql-bash: mysql: command not found
4. Set the mysql command and enter
1) alias mysql =/usr/local/mysql/bin/mysql
2) alias mysqladmin =/usr/local/mysql/bin/mysqladmin
Enter the mysql command again and you will find
chenhong:~ chenhong$ mysql-bash: mysql: command not foundchenhong:~ chenhong$ alias mysql=/usr/local/mysql/bin/mysqlchenhong:~ chenhong$ alias mysqladmin=/usr/local/mysql/bin/mysqladminchenhong:~ chenhong$ mysqlWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 36Server version: 5.1.63-log MySQL Community Server (GPL)Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
5. mysql Access denied for user root @ localhost error occurs when you use the database.
Mysql Access denied for user root @ localhost Error
Because of the permissions of the login account, use the highest permission to log on (the user name and password set during mysql installation)
$ Mysql-u root-p
Then the console will prompt you to enter the password
chenhong:~ chenhong$ mysql -u root -pEnter password:
After entering the password, you can use the database
mysql> use micro_messageDatabase changed