how to log in to mysql and query the database from linux terminal

后端 未结 12 2576
野趣味
野趣味 2020-12-04 06:47

I am using debian linux. I have a linux machine on which mysql is install. I can log in to my linux machine using root user as well as other user. I can connect to mysql dat

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 07:18

    1.- How do I get mysql prompt in linux terminal?

    mysql -u root -p
    

    At the Enter password: prompt, well, enter root's password :)

    You can find further reference by typing mysql --help or at the online manual.

    2. How I stop the mysql server from linux terminal?

    It depends. Red Hat based distros have the service command:

    service mysqld stop
    

    Other distros require to call the init script directly:

    /etc/init.d/mysqld stop
    

    3. How I start the mysql server from linux terminal?

    Same as #2, but with start.

    4. How do I get mysql prompt in linux terminal?

    Same as #1.

    5. How do I login to mysql server from linux terminal?

    Same as #1.

    6. How do I solve following error?

    Same as #1.

提交回复
热议问题