How to login MySQL server
MySQL is an open source database management software and user friendly. we can install the mysql database on our server and access it anywhere.
Follow the below steps to login to mysql server, for this you need to login shell prompt and do it.
Common Syntax :
mysql -u [mysql-user-name] -p [mysql-password] -h [mysql-server]
1) How to login MySql server
[email protected] [~]# mysql -u root -p Enter password: [Enter The mysql root password to login mysql server] Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 69759 Server version: 5.5.25 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 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>
2) How to Exit from MySql server
To exit from mysql prompt, use the below command.
mysql> quit Bye [email protected] [~]#
(1) If you installed the mysql server to other location, you need to give a full path to access mysql server. like installation directory is(/database/server/mysql). and access url is “bin” directory, like (/database/server/mysql/bin/mysql)
(2) If you want to access mysql database anywhere in server, you need add the path to “.bash_profile” file. How to add path to .bash_profile file.
For assistance, please update your query in our command section, one of our author give a solution.