MySQL Tip: MySQL Server Has Gone Away Or Lost connection to server during query FixJuly 24th, 2007 A much dreaded MySQL error message during queries is "MySQL server has gone away". An alternative message is "Lost connection to server during query".
How do I Enable Remote Access To MySQL Database?April 27th, 2009 Suppose you want to change and enable the remote access to MySQL DB on your linux server (Debian). By default, you don't get such privileges so you will have to work your way through this.
MySQL Tip: How To Check, Repair & Optimize All Tables in All DatabasesApril 20th, 2008 Here is a simple command to auto repair, check and optimize all the tables in all databases running on a MySQL server:
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
mysqlcheck is available in MySQL 3.23.38 and later. mysqlcheck uses the SQL statements CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE in a convenient way for the user.
How to Update or Change Password for a Single User in MySQL and Reload PrivilegesJanuary 17th, 2009 MySQL stores usernames and passwords in the user table inside the MySQL database. You can directly update a password using the following method to update or change passwords:
1) Login to the MySQL server, type the following command at the shell prompt:
$ mysql -u root -p
2) Use the mysql database (type commands at the mysql> prompt):
mysql> use mysql;
3) Change password for a user:
mysql> update user set password=PASSWORD("newpass") where User='YOUR-USER-NAME';
4) Reload privileges:
mysql> flush privileges;
mysql> quit
[P.S.
How To Migrate Mantis Defect Tracking System From Windows To Linux / Fedora Core 6May 12th, 2007 Mantis is popular php based defect tracking application which works on top of RDBMS like MySQL and PostgreSQL. Recently I ported our Windows based Mantis installation to Linux.
How to Backup & Restore MySQL DatabaseMay 13th, 2005 Note: My WordPress database name is wordpress. I will use it in the example below.
How to Recover MySQL Root PasswordJanuary 17th, 2009 Do you want to recover the MySQL root password. its by no means, easy.
Sun Restricts MySQL Query Analyzer Tool To Gold Subscribers OnlyNovember 25th, 2008 The MySQL Query Analyzer tool monitors query performance and quickly pinpoints and corrects problems in SQL code. It promises to "turbo-boost" the speed and uptime of MySQL database applications.
How To Test Master-Master / Master-Slave / Standard / Circular Replication on MySQLSeptember 1st, 2007 Working with replication systems is not easy. Learning and testing different kind of MySQL replications and fine-tuning it to your specific needs is a time-consuming endeavor.
MySQL High End Features Should be Closed Source & for Paid Customers OnlyApril 18th, 2008 I am serious. While MySQL is a great open source database, I have full respect to Sun's plan to provide high-end features for paying customers only.
Java: How To Get Auto Increment Values After SQL InsertJune 10th, 2007 While inserting a SQL query we do not specify the auto increment values, if any. However they are often required for further processing.
How To Disable On-Demand CPU Scaling on LinuxSeptember 3rd, 2008 Do you know that Linux automatically scales CPU utilization depending on processing requirements? This reduces power consumption and heat. However there are situations when CPU scaling monitor cannot properly identify CPU requirements.
Tip: How To Find MySQL VersionSeptember 1st, 2007 Try:
mysql -e status|grep 'Server version'
If that doesn't work then use:
mysql -u root -p -e status|grep 'Server version'
Provide root password when prompted. Default root password for MySQL is empty string, so just pressing enter when prompted for password will suffice by default.
Solution: MySQL Master-Master Replication Fails With ERROR 1200 (HY000) on MasterNovember 16th, 2007 When you try MySQL master-master replication with two (or more) servers you may often find that in the process of configuring the original master to also act as a slave server (start slave), it fails with the following error:
mysql> start slave;
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO
To rectify it locate and delete the master.info file and restart the mysql server. Now try to start slave and it should work.
How to Move the MySQL data directory in UbuntuJanuary 6th, 2009 MySQL data directory is the most important and sensitive place for any administrator. How do you move the whole data directory all on a sudden? There is no particular topic in the internet writing about it clearly.
October 17th, 2007 at 1:25 pm
That’s not PHP code
C/C++ perhaps.
October 18th, 2007 at 1:08 pm
It is PHP code. Check the fine manual
May 23rd, 2008 at 4:15 pm
There’s no mysql_options() command listed anywhere in PHP documentation that I can find (trying to use it gives an ‘undefined function’ error). my_bool is definitely not a PHP variable type. PHP variables also need $’s, of which you have none. I’m sorry, but this is NOT php code.
You provide useful explanation of auto-reconnection functionality, but please don’t mislead people by claiming it’s useful code for PHP developers.
August 18th, 2009 at 2:11 am
Hello. I have a question about reconnect. If automatic reconnection option is enable on my system, but the mysql server dose not work..then how many times will the system try to connect? Can I set the attempt count? And isn’t there any memory problem?(Is that sure mysql_close and open again?) I have some problem the option so I ask that. Thanks for reading.