Basic Mysql commands
Mysql is the database service , Following are few basic mysql commands used on linux server .The beloe mentioned commands can be executed from PhpMyadmin as those commands has to be executed from shell .
For finding important information about Mysql
Code:
--------------------------------------------
# mysql -e status
--------------------------------------------
To connect to the mysql prompt
Code:
--------------------------------------------
#mysql
--------------------------------------------
If you want to create a database named 'testdatabase'.
Code:
--------------------------------------------
#mysql>create database testdatabase;
--------------------------------------------
If a user want to create user and password
Code:
----------------------------------------------------------------------------------------
#mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
----------------------------------------------------------------------------------------
To check whether the mysql connection
Code:
--------------------------------------------
#mysql -u username -p databasename
--------------------------------------------
It will ask for password then enter the password
To use a database
Code:
--------------------------------------------
mysql> use databasename ;
--------------------------------------------
These above are some of the Mysql commands which can be fired from the shell prompt to find out the information or sort some mysql issue.
Mysql is the database service , Following are few basic mysql commands used on linux server .The beloe mentioned commands can be executed from PhpMyadmin as those commands has to be executed from shell .
For finding important information about Mysql
Code:
--------------------------------------------
# mysql -e status
--------------------------------------------
To connect to the mysql prompt
Code:
--------------------------------------------
#mysql
--------------------------------------------
If you want to create a database named 'testdatabase'.
Code:
--------------------------------------------
#mysql>create database testdatabase;
--------------------------------------------
If a user want to create user and password
Code:
----------------------------------------------------------------------------------------
#mysql> CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
----------------------------------------------------------------------------------------
To check whether the mysql connection
Code:
--------------------------------------------
#mysql -u username -p databasename
--------------------------------------------
It will ask for password then enter the password
To use a database
Code:
--------------------------------------------
mysql> use databasename ;
--------------------------------------------
These above are some of the Mysql commands which can be fired from the shell prompt to find out the information or sort some mysql issue.
Comment