SELECT * from emp_table ORDER BY category, name;
Category Archives: My SQL
list values with ORDER BY – mysql
SELECT * from emp_table ORDER BY name ASC;
Close MySQL connection – PHP
<?php
mysql_close();
?>
Command to check the status of MySql server – Ubuntu linux
service mysql status EX:service mysql status mysql start/running, process 1300
Command to restart MySQL – Ubuntu Linux
sudo /etc/init.d/mysql restart
Command to stop MySQL – Ubuntu Linux
sudo /etc/init.d/mysql stop
Command to start MySQL – Ubuntu Linux
sudo /etc/init.d/mysql start
Command to install MySQL – Ubuntu Linux
sudo apt-get install mysql-server
Linux command to export a database – MySQL
mysqldump -u USERNAME -p DATABASE-NAME > test.sql
Linux command to import a database – MySQL
mysql -u USERNAME -p -h localhost DATABSENAME < sql-file-name.sql