1.20 I receive the error “cannot load MySQL extension, please check PHP Configuration”.
To connect to a MySQL server, PHP needs a set of MySQL functions called “MySQL extension”. This extension may be part of the PHP distribution (compiled-in), otherwise it needs to be loaded dynamically. Its name is probably mysql.so or php_mysql.dll. phpMyAdmin tried to load the extension but failed.
Usually, the problem is solved by installing a software package called “PHP-MySQL” or something similar.
According to yast, php-mysql is installed
I’m wondering if something didn’t go wrong with the install process and whether I shouldn’t uninstall and re-install everything
Definitely looks like it hasn’t installed properly
There’s only stuff about postgresql and sqlite in phpinfo (only references to mysql are ini files), plus a pile of errors in the apache log like:
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php5/extensions/mysql.so’ - /usr/lib64/php5/extensions/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php5/extensions/mysqli.so’ - /usr/lib64/php5/extensions/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
I’ll try uninstalling and reinstalling everything mysql related
I had already installed php5-mysql, or to be more precise Yast did when I ran the hhtp server setup thinger in yast’s network services section
I’ve now uninstalled it using yast’s software manager, rebooted and re-installed it through yast, nothing has changed, I’m getting the exact same problem
; comment out next line to disable mysqli extension in php
extension=mysqli.so
; comment out next line to disable mysql extension in php
extension=mysql.so
and of course you should have restarted Apache before browsing that page with phpinfo();
/usr/sbin/a2enmod -l
authz_host actions alias auth_basic authz_groupfile authn_file authz_user autoindex cgi dir include log_config mime negotiation setenvif status userdir asis imagemap php5 perl authz_default
php5 is there
ls /usr/lib64/php5/extensions/mysql*
/usr/lib64/php5/extensions/mysqli.so /usr/lib64/php5/extensions/mysql.so
Outputs what you said to expect
cat /etc/php5/conf.d/mysql*
; comment out next line to disable mysqli extension in php
extension=mysqli.so
; comment out next line to disable mysql extension in php
extension=mysql.so
Also outputs what you said to expect
I’ve now got into phpMyAdmin with no errors other than the expected one about no root password being set
But if I log into mysql as root and do show databases; I’m getting this:
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| test |
±-------------------+
2 rows in set (0.00 sec)
Shouldn’t there be a database called mysql? Or will I not see it until I create a root password?
If I remember rightly I put the root password in my.cnf?
You’ve probably messed up your MySQL permissions. It’s hard to know exactly what you did but it looks the “root” account in mysql (which has nothing to do with the root account in Linux BTW, other than that the logged in user is the default username when -u is not specified to mysql) doesn’t have permissions on all databases.
If you have nothing of value in MySQL, I would recommend a shutdown of mysql and then a reinstall of all mysql-* packages, but first delete everything under /var/lib/mysql first because a reinstall of mysql packages doesn’t remove the existing databases, for obvious reasons. And read the command line twice before hit return on the rm -fr /var/lib/mysql Oh and also remove my.cnf before the reinstall to start afresh.
Nothing of value in mysql yet mate, the whole suse install is fresh and I’ve not gotten the mysql working properly yet
How I’ve managed to mess up permissions I’ve no idea because all I did is run the yast setup which went without a hitch when I did it in 10.2 and 10.3
Logged into mysql with mysql -h localhost -u root so I should see whatever databases are there (unless I have that wrong)
This is back to the original problem of the mysql database itself not having been created and a reinstall of mysql didn’t fix it, but I didn’t remove the stuff you mentioned first as I expected it to just recreate the database
I’ll give it another go following your instruction
The mysql DB in mysql ought to be there you can look for it as a subdirectory in /var/lib/mysql called mysql of course. If it isn’t there, mysql cannot function as this contains information about what DBs are there, what users are registered, etc. That you cannot see it in the “root” account probably means “root” isn’t powerful enough and somehow some restrictions for “root” were added to the mysql database.
Sometimes mysql databases also get messed up by people who start mysql manually from the command line as root, instead of doing it via the init script /etc/init.d/mysql or the symlink rcmysql or via YaST services configuration. This causes data files to be owned by root rather than the mysql account and therefore inaccessible when mysql is properly started up.
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| test |
±-------------------+
3 rows in set (0.00 sec)
It was removing the var/lib/mysql dir that did it, I pretty much knew it was picking up the existing databases on the re-install, but I didn’t know where they ‘live’ in order to get rid of them first
Thanks to you, now I do, once they were gone it was able to recreate the new default ones
As to why they weren’t created properly by yast in the first place I have absolutely no idea