How to execute SQL query from Jailed shell (SSH) access?

  • Access Jailed SSH using the command below,
 

========

ssh username@server_ip_address -p port_number

========

 

where,

========

username: Username which you are trying to access

server_ip_address: Server actual IP address

port_number: Server port number

Password: Your Jailed SSH access password

========

 

After entering, you need to follow below,

 

  • At the command line, type the following command, replacing USERNAME with your username:
mysql -u USERNAME -p
 

At the Enter Password prompt, type your password. When you type the correct password, the mysql> prompt appears. Then you can execute the MySQL commands in there. Some of it are listed below,

 

  • To display a list of databases, type the following command at the mysql> prompt:

show databases;

 
  • To access a specific database, type the following command at the mysql> prompt, replacing DBNAME with the database that you want to access:

use DBNAME;

 

After you access a database, you can run SQL queries, list tables, and so on. Additionally:

 

 

  • To view a list of MySQL commands, type help at the mysql> prompt.
  • To exit the MySQL program, type "q" at the mysql> prompt.




Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 7848