MyBB Community Forums

Full Version: mysql server unable to run
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I had some weird things happen, that i figured needed a reboot.

After I rebooted I went to my forums to find this error msg:
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
2002 - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Query:
[READ] Unable to connect to MySQL server


after this i tried to start/stop/restart mysql server:
metulburr@ubuntu:~$ sudo /etc/init.d/mysql restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mysql ; start mysql. The restart(8) utility is also available.
start: Job failed to start
metulburr@ubuntu:~$ sudo /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
metulburr@ubuntu:~$ mysq
No command 'mysq' found, did you mean:
 Command 'mysql' from package 'mysql-client-core-5.5' (main)
mysq: command not found
metulburr@ubuntu:~$ /bin/mysq
bash: /bin/mysq: No such file or directory
metulburr@ubuntu:~$ /bin/mysql
bash: /bin/mysql: No such file or directory
metulburr@ubuntu:~$ sudo /etc/init.d/mysql start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql
start: Job failed to start
metulburr@ubuntu:~$ service mysql start
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.68" (uid=1000 pid=4282 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
metulburr@ubuntu:~$ start mysql
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.69" (uid=1000 pid=4293 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
metulburr@ubuntu:~$ mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
metulburr@ubuntu:~$ 

I see the error msgs, but not sure what to do about it?[/code]
The command in Ubuntu is:

Quote:metulburr@ubuntu:~$ service mysql restart

DO NOT restart MySQL under init.d as it says in the command.

As far as the error, I would assume that:

1) You have spelt the password or username incorrect in the /inc/config.php file of your MyBB install
2) MySQL is not installed, Or turned on.
metulburr@ubuntu:~$ service mysql start
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.80" (uid=1000 pid=10208 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
metulburr@ubuntu:~$
mysql is installed as Mybb was running OK before I rebooted and the passwd/username
<?php
/**
 * Database configuration
 *
 * Please see the MyBB Wiki for advanced
 * database configuration for larger installations
 * http://wiki.mybb.com/
 */

$config['database']['type'] = 'mysqli';
$config['database']['database'] = 'mybb';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'localhost';
$config['database']['username'] = 'root';
$config['database']['password'] = 'PASSWORD
';

/**
* Admin CP directory
* For security reasons, it is recommended you
* rename your Admin CP directory. You then need
* to adjust the value below to point to the
* new directory.
*/

$config['admin_dir'] = 'admin';

/**
* Hide all Admin CP links
* If you wish to hide all Admin CP links
* on the front end of the board after
* renaming your Admin CP directory, set this
* to 1.
*/

$config['hide_admin_links'] = 0;

/**
* Data-cache configuration
* The data cache is a temporary cache
* of the most commonly accessed data in MyBB.
* By default, the database is used to store this data.
*
* If you wish to use the file system (cache/ directory), MemCache, xcache, or eAccelerator
* you can change the value below to 'files', 'memcache', 'xcache' or 'eaccelerator' from 'db'.
*/

$config['cache_store'] = 'db';

/**
* Memcache configuration
* If you are using memcache as your data-cache,
* you need to configure the hostname and port
* of your memcache server below.
*
* If not using memcache, ignore this section.
*/

$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;

/**
* Super Administrators
* A comma separated list of user IDs who cannot
* be edited, deleted or banned in the Admin CP.
* The administrator permissions for these users
* cannot be altered either.
*/

$config['super_admins'] = '1';

/**
* Database Encoding
* If you wish to set an encoding for MyBB uncomment
* the line below (if it isn't already) and change
* the current value to the mysql charset:
* http://dev.mysql.com/doc/refman/5.1/en/c...mysql.html
*/

$config['database']['encoding'] = 'utf8';

/**
* Automatic Log Pruning
* The MyBB task system can automatically prune
* various log files created by MyBB.
* To enable this functionality for the logs below, set the
* the number of days before each log should be pruned.
* If you set the value to 0, the logs will not be pruned.
*/

$config['log_pruning'] = array(
'admin_logs' => 365, // Administrator logs
'mod_logs' => 365, // Moderator logs
'task_logs' => 30, // Scheduled task logs
'mail_logs' => 180, // Mail error logs
'user_mail_logs' => 180, // User mail logs
'promotion_logs' => 180 // Promotion logs
);

?>[code]