The Blog


ORDER BY with NULL at the bottom

Posted on

MySQL has an undocumented syntax to sort nulls last. Place a minus sign (-) before the column name and switch the ASC to DESC:

SELECT * FROM tablename WHERE visible=1 ORDER BY -position DESC, id DESC

It is essentially the inverse of position DESC placing the NULL values last but otherwise the same as position ASC.

Posted in MySQL Leave a comment

What is the root password for MySQL?

Posted on

Article ID: 427
Last Review: Jul, 5 2011


Parallels Plesk Panel renames ‘root’ mysql account to ‘admin’
when the Panel is installed.

To get root privileges in mysql simply login with the ‘admin’ username instead. The password is the same as the admin password in Parallels Plesk Panel.

On server with Parallels Plesk Panel versions 8.x, 9.x and above admin password is stored in file /etc/psa/.psa.shadow. Use the following command to get the

cat /etc/psa/.psa.shadow

Since version 10 admin password stored in file /etc/psa/.psa.shadow is encrypted. Use the following command to get admin password in plain text:

~# /usr/local/psa/bin/admin --show-password

Despite version of Parallels Plesk Panel you may use the following command to login to mysql with root privileges:

~# mysql -uadmin -p`cat/etc/psa/.psa.shadow`
Posted in MySQL, PLESK Leave a comment

Change port 80 to 81 on Wampserver

Posted on

I assume your server Configuration:
Apache Version: 2.2.
PHP Version:   5.2.6

Now that you have WampServer 2.0 installed, you’ll want to use it along side   with other servers such as IIS. This is easily done by changing the port that   WampServer 2.0 listens to. I suggest changing the port from 80 to 81.
Read More

Posted in MySQL, PHP 8 Comments
« Previous PageNext Page »