Cool MySQL Tips from Students

From Mayumi Togawa:

  1. If you aren't sure whether MySQL is running:

    C:\mysql\bin>mysqladmin ping

    If MySQL is running, it returns
         mysqld is alive
       if not, it will be
         ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)
     
  2. If your mysqld is alive, you can connect mysql without any troubles.
       If not, you can start mysql manually by typing

       C:\mysql\bin>net start mysql

    To stop connection manually, the command is:
     net stop mysql
     
  3. When you are in mysql and want to know the conditions like
       connection ID, current databese and current user etc.,
       you can type

       mysql> \s
     
  4. User information is stored at the table 'user' of database 'mysql' .
       When you want to look at its records one by one, type

       mysql> select * from mysql.user \G
       (The G is case-sensitive)
     
  5. For help:

       C:\mysql\bin>mysql -?
       or
      C:\mysql\bin>mysql --help
     

From Cathy Falk:

To get a DOS window customized to start at C:\mysql\bin (or wherever you have MySQL):

  1. Go to Start, on your desktop. Either in plain sight or from Start/All Programs/Accessories, find the icon for a DOS window. ("DOS window" is what I call it;  Command Prompt is the official term.) Drag this icon onto your desktop.
  2. Right-click in the icon and pull down to Properties. You can customize all kinds of things: font, width, colors, etc. The useful one for our purposes is Start In. Type C:\ and start any folder name; you will be offered all correct possibilities. Keep typing until you see the folder you want; double-click on it. Type a / and keep going until you have the complete path. Click Apply and it will be that way, whenever you double click on the icon on your desktop.
  3. If you like, drag the icon to you quick-launch bar.

There will be more. If you sent something and don't see it here, remind me.

And everyone else: feel free. This is great.

 Back to Dan McCracken's  Home Page