Mysql for Mac and mysql for Mac

Source: Internet
Author: User

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






Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.