How to Connect to MySql Database using MAC terminal

How to Connect to MySql Database using MAC terminal
1. Open your terminal. 

2. Check your current directory by typing pwd.

$ pwd

Output :

/usr/local/mysql/bin

your directory should be the bin folder of mysql else go to that directory by typing.

$ cd /usr/local/mysql/bin

3. When you are in mysql bin folder login to your mysql database using below command and enter password.

$ ./mysql -u root -p Enter password:

Output :

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 93 Server version: 5.7.19 MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>

If you see above welcome message then you are logged in to your mysql database.

No comments:

Post a Comment

Featured Post

H1B Visa Stamping at US Consulate

  H1B Visa Stamping at US Consulate If you are outside of the US, you need to apply for US Visa at a US Consulate or a US Embassy and get H1...