Failure to configure mysql for LAMP server (openSUSE 12.3(x64))

In a recent installation of OpenSUSE 12.3 (64-bit) (dual booting with Windows 8), after installing patterns-openSUSE-lamp_server (though after installing packages for apache2, php5 and mysql, the following result was obtained (bash-Konsole) when attempting to configure mysql:

linux-7mkm:~ # cd /bin
linux-7mkm:/bin # mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in ‘/var/lib/mysql’ …
131009 15:18:10 [ERROR] mysqld: Can’t lock aria control file ‘/var/lib/mysql/aria_log_control’ for exclusive use, error: 11. Will retry for 30 seconds
131009 15:18:41 [ERROR] mysqld: Got error ‘Could not get an exclusive lock; file is probably in use by another process’ when trying to use aria control file ‘/var/lib/mysql/aria_log_control’ 131009 15:18:41 [ERROR] Plugin ‘Aria’ init function returned error.
131009 15:18:41 [ERROR] Plugin ‘Aria’ registration as a STORAGE ENGINE failed.
ERROR: 1017 Can’t find file: ‘/tmp/#sql_fbd_0’ (errno: 2)
131009 15:18:41 [ERROR] Aborting 131009 15:18:41 [Note] /usr/sbin/mysqld: Shutdown complete

Installation of system tables failed!
Examine the logs in /var/lib/mysql for more information. The problem could be conflicting information in an external my.cnf files. You can ignore these by doing:

shell> /scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /usr/sbin/mysqld --skip-grant --general-log &

and use the command line tool /usr/bin/mysql to connect to the mysql database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try ‘mysqld --help’ if you have problems with paths. Using
–general-log gives you a log in /var/lib/mysql that may be helpful.

The latest information about mysql_install_db is available at http://kb.askmonty.org/v/installing-system-tables-mysql_install_db.
MariaDB is hosted on launchpad; You can find the latest source and email lists at http://launchpad.net/maria

Please check all of the above before mailing us! And remember, if you do mail us, you should use the /usr/bin/mysqlbug script!

At this point the /var/lib/mysql directory contains :

-rw-rw---- 1 mysql mysql 16384 Oct 11 18:54 aria_log.00000001
-rw-rw---- 1 mysql mysql 52 Oct 11 18:54 aria_log_control
-rw-rw---- 1 mysql mysql 18874368 Oct 11 18:54 ibdata1
-rw-rw---- 1 mysql mysql 5242880 Oct 11 21:07 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Oct 8 23:06 ib_logfile1
drwx------ 2 mysql root 4096 Oct 8 23:06 mysql
-rw-r–r-- 1 root root 6 Oct 8 23:06 mysql_upgrade_info
drwx------ 2 mysql mysql 4096 Oct 8 23:06 performance_schema
drwx------ 2 mysql root 4096 Oct 8 23:06 test

With little experience of shell commands, I have not made any progress with the above advice, except to find in the file ~/.config/Trolltech.conf two references to mysql:
usr\lib64\qt4\plugins\sqldrivers\libqsqlmysql.so=40804, 0, x86_64 linux g+±4 full-config, 2013-05-17T12:28:59
com.trolltech.Qt.QSqlDriverFactoryInterface%3A\usr\lib64\qt4\plugins\sqldrivers\libqsqlmysql.so=2013-05-17T12:28:59, QMYSQL3, QMYSQL

Before realising that I could use the LAMP pattern, I had installed and tested the apache2 server and configured php5 and (perhaps unwisely) copied some files from a separate OpenSUSE 12.2 installation into the htdocs directory. Are these, or the order/methods of installation of mysql or other packages, or a pre-existing ‘native’ configuration of 12.3 causing the conflict. I want to use mysql with php (with any local user accessing localhost) but do not expect to need to access mysql through LibreOffice Base.

So, what to do next?

Hi, welcome.

Must say, I haven’t read all the output (reason below), but dealing with LAMP on openSUSE is a daily routine.

One thing first: post output between CODE tags, the # in the editor. The way it’s posted now (in proportional font and spacing) it’s very hard to read.
Second: when trying to resolve 127.0.0.1 in a browser does the webpage say “It works!!”? If so, apache works.
Third: Is mysql running anyway
Fourth: did you create a mysl root user, a mysql user for your databases? If not, this has to be done first.
Next: install phpMyAdmin, go to http://127.0.0.1/phpMyAdmin , login with root user (or any other created user with enough privileges), create the db for your site, adjust settings in site’s config.

One thing: don’t do that, the package installation takes care of everything.
Just start the mysql server:

sudo systemctl start mysql

To automatically start it on boot:

sudo systemctl enable mysql

To check if it is running:

sudo systemctl status mysql

If you ran mysql_install_db before anything else, you have missed out an important step, running mysql_secure_installation.

If you have plenty of mysql experience, you should know how you need to answer each question; if you don’t and you haven’t yet set a root password, the answer to all the questions is y.

My apologies for badly formatted message – hopefully improved below.
And thanks for the helpful questions/suggestions.

vrdn

In a recent installation of OpenSUSE 12.3 (64-bit) (dual booting with Windows 8), after installing patterns-openSUSE-lamp_server (though after installing packages for apache2, php5 and mysql, the following result was obtained (bash-Konsole) when attempting to configure mysql:


linux-7mkm:~ # cd /bin 
linux-7mkm:/bin # mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ... 
131009 15:18:10 [ERROR] mysqld: Can't lock aria control file  '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will  retry for 30 seconds 
131009 15:18:41 [ERROR] mysqld: Got error 'Could not get an exclusive  lock; file is probably in use by another process' when trying to use  aria control file '/var/lib/mysql/aria_log_control' 131009 15:18:41  [ERROR] Plugin 'Aria' init function returned error. 
131009 15:18:41 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. 
ERROR: 1017  Can't find file: '/tmp/#sql_fbd_0' (errno: 2) 
131009 15:18:41 [ERROR] Aborting  131009 15:18:41 [Note] /usr/sbin/mysqld: Shutdown complete 

Installation of system tables failed!  
Examine the logs in /var/lib/mysql for more information.  The problem  could be conflicting information in an external my.cnf files. You can  ignore these by doing:      

shell> /scripts/mysql_install_db --defaults-file=~/.my.cnf  

You can also try to start the mysqld daemon with:      

shell> /usr/sbin/mysqld --skip-grant --general-log &  

and use the command line tool /usr/bin/mysql to connect to the mysql database and look at the grant tables:      

  shell> /usr/bin/mysql -u root mysql     
  mysql> show tables  
Try 'mysqld --help' if you have problems with paths.  Using 
--general-log gives you a log in /var/lib/mysql that may be helpful.  

The latest information about mysql_install_db is available at [http://kb.askmonty.org/v/installing-...sql_install_db](http://kb.askmonty.org/v/installing-system-tables-mysql_install_db). 
MariaDB is hosted on launchpad; You can find the latest source and email lists at http://launchpad.net/maria  

Please check all of the above before mailing us!  And remember, if you do mail us, you should use the /usr/bin/mysqlbug script!

At this point the /var/lib/mysql directory contains :

-rw-rw---- 1 mysql mysql    16384 Oct 11 18:54 aria_log.00000001
-rw-rw---- 1 mysql mysql       52 Oct 11 18:54 aria_log_control
-rw-rw---- 1 mysql mysql 18874368 Oct 11 18:54 ibdata1
-rw-rw---- 1 mysql mysql  5242880 Oct 11 21:07 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 Oct  8 23:06 ib_logfile1
drwx------ 2 mysql root      4096 Oct  8 23:06 mysql
-rw-r--r-- 1 root  root         6 Oct  8 23:06 mysql_upgrade_info
drwx------ 2 mysql mysql     4096 Oct  8 23:06 performance_schema
drwx------ 2 mysql root      4096 Oct  8 23:06 test

With little experience of shell commands, I have not made any progress with the above advice, except to find in the file ~/.config/Trolltech.conf two references to mysql:

usr\lib64\qt4\plugins\sqldrivers\libqsqlmysql.so=40804, 0, x86_64 linux g++-4 full-config, 2013-05-17T12:28:59
com.trolltech.Qt.QSqlDriverFactoryInterface%3A\usr\lib64\qt4\plugins\sqldrivers\libqsqlmysql.so=2013-05-17T12:28:59,  QMYSQL3, QMYSQL

Before realising that I could use the LAMP pattern, I had installed and tested the apache2 server and configured php5 and (perhaps unwisely) copied some files from a separate OpenSUSE 12.2 installation into the htdocs directory. Are these, or the order/methods of installation of mysql or other packages, or a pre-existing ‘native’ configuration of 12.3 causing the conflict. I want to use mysql with php (with any local user accessing localhost) but do not expect to need to access mysql through LibreOffice Base.

So, what to do next?

Happily, it’s working!

In summary:

Checked that both apache2 and mysql were both running, then all that was needed to get back on track was:

/usr/bin/mysql_secure_installation

inviting addition of the root user and password. Then, to use mysql:

srvadmin@linux-7mkm:~> mysql -u root -p

I found enough help in the package documentation to configure phpMyAdmin and to confirm that mysql is accessible in php.

Many thanks for the help.

vrdn