MySQL wont work from default install - CentOS

Hi,

I have a pretty new CentOS install, with currently just Nginx running. I have installed MySQL a few times before on Debian and never faced any problems.

However doing a install of MySQL on CentoOS I have been having problems. Either the service wont start, or it does but I cant login with a password. If I follow the password reset guide and when trying to login I get 'cant login root@localhost'.

Im running the LATEST kernel, as I had to updgrade it to get Nginx to work.

Latest 2.6 Paravirt (2.6.32.16-linode28))

The problem I have at the moment is as follows:

[root@flex ~]# cat /etc/redhat-release

CentOS release 5.5 (Final)

[root@flex ~]# uname -a

Linux flex 2.6.32.16-linode28 #1 SMP Sun Jul 25 21:32:42 UTC 2010 i686 i686 i386 GNU/Linux

[root@flex ~]# /etc/init.d/mysqld start

Timeout error occurred trying to start MySQL Daemon.

Starting MySQL: [FAILED]

101221 16:49:02 mysqld started

101221 16:49:02 [Warning] option 'maxjoinsize': unsigned value 18446744073709551615 adjusted to 4294967295

101221 16:49:02 [Warning] option 'maxjoinsize': unsigned value 18446744073709551615 adjusted to 4294967295

101221 16:49:02 InnoDB: Operating system error number 13 in a file operation.

InnoDB: The error means mysqld does not have the access rights to

InnoDB: the directory.

InnoDB: File name ./ibdata1

InnoDB: File operation call: 'open'.

InnoDB: Cannot continue operation.

101221 16:49:02 mysqld ended

/tmp

drwxrwxrwt 4 root root 4096 Dec 21 16:49 tmp

/var/tmp

drwxrwxrwt 3 root root 4096 Dec 21 16:48 tmp

[root@flex ~]# cat /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

Default to using old password format for compatibility with mysql 3.x

clients (those using the mysqlclient10 compatibility package).

old_passwords=1

Disabling symbolic-links is recommended to prevent assorted security risks;

to do so, uncomment this line:

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

I hope someone can help me as Im worried Im going to have to rebuild my VPS in case, and still I may have a problem.

If any other details are needed, let me know.

3 Replies

@Flex:

101221 16:49:02 InnoDB: Operating system error number 13 in a file operation.

InnoDB: The error means mysqld does not have the access rights to

InnoDB: the directory.

InnoDB: File name ./ibdata1

InnoDB: File operation call: 'open'.

InnoDB: Cannot continue operation.

101221 16:49:02 mysqld ended

Make sure whatever mysql runs as has access to ./ibdata etc in the mysql data dir.

Thanks for that. So I updated the conf file so 'root' is the user. Now I get:

[root@flex ~]# mysql -u root -p

Enter password:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@flex ~]# mysql -u root

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

[root@flex ~]#

101221 17:19:09 mysqld started

101221 17:19:09 [Warning] option 'maxjoinsize': unsigned value 18446744073709551615 adjusted to 4294967295

101221 17:19:09 [Warning] option 'maxjoinsize': unsigned value 18446744073709551615 adjusted to 4294967295

101221 17:19:09 [Warning] Ignoring user change to 'mysql' because the user was set to 'root' earlier on the command line

101221 17:19:09 InnoDB: Started; log sequence number 0 43665

101221 17:19:09 [Note] /usr/libexec/mysqld: ready for connections.

Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

[root@flex ~]#

You shouldn't run mysql as root, run it as mysql and chmod the directory so mysql has access then reset the password as normal.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct