MySQL: Trying to update to 5.5

MySQLmysql-5mysql-5.5

I've followed this instructions, but after mysqld --skip-grant-tables --user=mysql, I'm getting this:

110913 20:29:18 [Warning] Can't create test file /var/lib/mysql/my-laptop.lower-test
110913 20:29:18 [Warning] Can't create test file /var/lib/mysql/my-laptop.lower-test
mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)
110913 20:29:18 [ERROR] Aborting
110913 20:29:18 [Note] mysqld: Shutdown complete

what I think it could be normal because the tutorial ask to do "rm -R /var/lib/mysql" on the step before. So I then create /var/lib/mysql, execute again "mysqld –skip……" and I get this:

110913 20:32:07 [Note] Plugin 'FEDERATED' is disabled.
110913 20:32:07  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: 'create'.
InnoDB: Cannot continue operation.

This is my /etc/my.cnf:

 # The following options will be passed to all MySQL clients
[client]
user            = mysql
#password    = your_password
port        = 3306
socket        = /var/run/mysqld/mysqld.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
socket        = /var/run/mysqld/mysqld.sock
port        = 3306
basedir         = /usr/local/mysql
datadir         = /usr/local/mysql/data
tmpdir          = /tmp
log_error       = /var/log/mysql/error.log 
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

I have ubuntu 10.10.

Any idea?

Javi

Best Answer

The error means mysqld does not have the access rights to the directory.

When you recreated /var/lib/mysql, you need to make sure the /var/lib/mysql directory is owned and writeable by the mysql user.