The error is due to a bug in a Perl library Munin uses which causes $PATH variable to be lost, and then causes the plugin cannot find the mysqladmin program which it needs to retrieve the numbers to populate in the graphs. Uninstall and reinstall Munin Service Monitor may make it works again, however, a more permanent solution is to hardcode the path of the program, which will fix the problem. Here the guide on how to specify the path to mysqladmin to Munin.

Fix for Munin installed by cPanel/WHM

   1. Determine where is mysqladmin program located with the one of the following command:

      which mysqladmin
      type mysqladmin
      locate mysqladmin

      If should return a path to mysqladmin which looks similar or the same to /usr/bin/mysqladmin.

   2. Edit the /etc/munin/plugin-conf.d/cpanel.conf Munin configuration file, and modify the [mysql*] to look like below:
      [mysql*]
      user root
      group wheel
      env.mysqladmin /usr/bin/mysqladmin
      env.mysqlopts –defaults-extra-file=/root/.my.cnf
Read the rest of this entry…

none

Phpmyadmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. phpMyAdmin supports a wide range of operations with MySQL. Since Windows doesn’t include a GUI  managment tool for Mysql, you will need to install phpMyadmin to acess a GUI  rather than administratering Mysql via the command line interface.

Please be sure that your php installation already has the GD/GD2 Library, Mysql and MBString extensions active. You can see this by going to your IIS server and accessing the php test page. If you do not have one, you can make one by going to “C:\inetpub\wwwroot\ and my creating a text with the following line;

<? phpinfo(); ?>

Save the file as phptest.php.

This will allow you to goto Http://localhost/phptest.php. If you don’t see the Mysql or MBstring sections, you will need to have them enabled to proceed as phpMyadmin requires this.
Read the rest of this entry…

none

I’ve found that in my journies, the easist way to reset a mysql password, assuming you have SSH / Shell access is to log into the server and change it. To do this, you need to do the following;

1. Login to the server via SSH.

2. Once logged in, you’ll need to modify the my.cnf file to force your mysql to skip the grant tables. This will allow you to reset mysql so you can gain access without providing the password. One of the benefits of SSH access.

The my.cnf file will look like this;

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
#skip-grant-tables  <— This is the line we add. Remove the # to enable it. Once done remove that or place the # back into place.
[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

3. Now that you added this, reset mysql.

4. Once mysql is restarted, you can gain access to it directly by typing ;

$ mysql -u root

It may ask for a password, but you can ignore it.

5. Now that you are logged in, will need to access the mysql database;

use mysql;

6. Lastly, we need to change the password by running the following;

UPDATE user SET password=PASSWORD(’newpassword’) WHERE user=’root’;

7. Now you can remove the line in the my.cnf that we added in step 2. Once you remove it, save the configuration and restart mysql.

That’s it. The password has been changed!

none

The easiest way to backup your database would be to telnet to the your database server machine and use the mysqldump command to dump your whole database to a backup file. If you do not have telnet or shell access to your server, don’t worry about it; I shall outline a method of doing so using the PHPMyAdmin web interface, which you can setup on any web server which executes PHP scripts.

Mysqldump

If you have either a shell or telnet access to your database server, you can backup the database using mysqldump. By default, the output of the command will dump the contents of the database in SQL statements to your console. This output can then be piped or redirected to any location you want. If you plan to backup your database, you can pipe the output to a sql file, which will contain the SQL statements to recreate and populate the database tables when you wish to restore your database. There are more adventurous ways to use the output of mysqldump.

A Simple Database Backup:

You can use mysqldump to create a simple backup of your database using the following syntax.

mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]

o [username] - this is your database username
o [password] - this is the password for your database
o [databasename] - the name of your database
o [backupfile.sql] - the file to which the backup should be written.

The dump file will contain all the SQL statements needed to create the table and populate the table in a new database server. To backup your database ‘Customers’ with the username ’sadmin’ and password ‘pass21′ to a file custback.sql, you would issue the command:

mysqldump -u sadmin -p pass21 Customers > custback.sql

You can also ask mysqldump to add a drop table command before every create command by using the option –add-drop-table. This option is useful if you would like to create a backup file which can rewrite an existing database without having to delete the older database manually first.

mysqldump –add-drop-table -u sadmin -p pass21 Customers > custback.sql

*Note* - you don’t have to specify the password in the syntax. If you choose not to, it will simply ask for it once you implement the command.

Importing dumped file.

Now that you have the dump file, you’ll need to upload it to the server you need to restore the database to. Once you’ve done this you can connect to the server via SSH (linux) or RDC (windows). To import the file you can either browse to the directory first or you can specify the directory in the import syntax;

Now import the dump file into MySQL by typing all the following on 1 single line at the shell prompt:

mysql -p -h DBSERVER Customers < custback.sql

Basically you are telling Mysql to import custback.sql to the database Customers on the localhost.

The above assumes that your database name on our system is “Customers ” and the dumpfile that you uploaded was named “custback.sql”. Replace those with your correct database name and dumpfile filename. Also replace DBSERVER with your correct database server name.

none

MySQL max_allowed_packet

In which case, try adding one to your my.cnf file;

set-variable=max_allowed_packet=xM
Change ‘x’ to 1 (or increase it if you’re still getting errors)

If you are using the mysql client program, its default max_allowed_packet variable is 16MB. That is also the maximum value before MySQL 4.0. To set a larger value from 4.0 on, start mysql like this:

mysql> mysql –max_allowed_packet=32M

That sets the packet size to 32MB.

The server’s default max_allowed_packet value is 1MB. You can increase this if the server needs to handle big queries (for example, if you are working with big BLOB columns). For example, to set the variable to 16MB, start the server like this:

mysql> mysqld –max_allowed_packet=16M

Before MySQL 4.0, use this syntax instead:

mysql> mysqld –set-variable=max_allowed_packet=16M

You can also use an option file to set max_allowed_packet. For example, to set the size for the server to 16MB, add the following lines in an option file:

[mysqld]
max_allowed_packet=16M

Before MySQL 4.0, use this syntax instead:

[mysqld]
set-variable = max_allowed_packet=16M

It’s safe to increase the value of this variable because the extra memory is allocated only when needed. For example, mysqld allocates more memory only when you issue a long query or when mysqld must return a large result row. The small default value of the variable is a precaution to catch incorrect packets between the client and server and also to ensure that you don’t run out of memory by using large packets accidentally.

You can also get strange problems with large packets if you are using large BLOB values but have not given mysqld access to enough memory to handle the query. If you suspect this is the case, try adding ulimit -d 256000 to the beginning of the mysqld_safe script and restarting mysqld.

The max_allowed_packet option specifies how large your MySQL Query/Data Packet can be, and NOT the Maximum File Size that MySQL can maintain. MySQL can theoretically handle database files upto 1 Terrabyte in size.

none