VectorLinux

The nuts and bolts => Technical General => Topic started by: StrayBit on March 15, 2017, 02:10:52 pm

Title: mysqld OPPS
Post by: StrayBit on March 15, 2017, 02:10:52 pm
I am working with VL7.2beta and am trying to get mysql running.
I have tried
Quote
bruce: mysqld&
and
Quote
root: mysqld&
In both cases it finally exits.  During the process (in thunar) I created /var/mysql directory and changed the permissions so everyone had read/write.  Perhaps I need to do something else?
Title: Re: mysqld
Post by: StrayBit on March 21, 2017, 11:23:08 am
Further "playing"
Quote
vector://home/bruce
root:# mysql_install_db --user=mysql
2017-03-21 17:15:56 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2017-03-21 17:15:56 [ERROR]   The data directory needs to be specified.
vector://home/bruce
root:# mysqld --initialize
2017-03-21T23:18:27.167927Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-03-21T23:18:27.390065Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-03-21T23:18:27.390190Z 0 [ERROR] Aborting
I haven't been able to figure out what documentation or file it is reading to figure out the context of these statements.
Quote
vector://home/bruce
root:# mysql restart
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
There is no mysqld directory in /run - ah there is one in /usr/run but it is empty
Upon perusal of info mysqld, I realize that it is for client operations - not server!
Title: Re: mysqld
Post by: M0E-lnx on March 22, 2017, 07:35:12 am
So it looks like our package could use some tweaking.

I have successfully launched the mysql daemon my doing following these steps.

1. slapt-get -i mysql
2. mkdir /run/mysqld
3. chown mysql:mysql /run/mysqld
4. mysqld --initialize --user=mysql
5. chmod +x /etc/rc.d/rc.mysqld
6. /etc/rc.d/rc.mysqld stop
7. /etc/rc.d/rc.mysqld start

Let me know if this works for you and I can get the package fixed so that this is done automatically.  You will need to uninstall mysql and remove /var/lib/mysqld so you can re-test this.

As a side note, mysql has been replaced with mariadb, you may want to try that instead (but we still need to fix the mysql package)

Hope this helps
Title: Re: mysqld
Post by: StrayBit on March 22, 2017, 08:19:47 am
Quote
vector://home/bruce
root:# slapt-get -i mysql
Reading Package Lists...Done
mysql is up to date.
0 upgraded, 0 reinstalled, 0 newly installed, 0 to remove, 0 not upgraded.

Done
vector://home/bruce
root:# mkdir /run/mysqld
vector://home/bruce
root:# chown mysql:mysql /run/mysqld
vector://home/bruce
root:# mysqld --initialize --user=mysql
2017-03-22T15:01:45.203512Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-03-22T15:01:45.458954Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-03-22T15:01:45.459054Z 0 [ERROR] Aborting

vector://home/bruce
root:# chmod +x /etc/rc.d/rc.mysqld
vector://home/bruce
root:# /etc/rc.d/rc.mysqld stop
vector://home/bruce
root:# /etc/rc.d/rc.mysqld start
vector://home/bruce
root:# 2017-03-22T15:02:59.752529Z mysqld_safe Logging to '/var/lib/mysql/vector.err'.
Logging to '/var/lib/mysql/vector.err'.
2017-03-22T15:02:59.830918Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-03-22T15:03:10.499133Z mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
It was unable to open the index file
PS: It doesn't help to skip a step!  As soon as I get back, I'll try starting httpd.
Title: Re: mysqld
Post by: StrayBit on March 22, 2017, 09:19:13 am
Had shut down after previous post.
Quote
vector://home/bruce
root:# /etc/rc.d/rc.mysqld start
vector://home/bruce
root:# 2017-03-22T16:05:24.104356Z mysqld_safe Logging to '/var/lib/mysql/vector.err'.
2017-03-22T16:05:24.109989Z mysqld_safe Logging to '/var/lib/mysql/vector.err'.
2017-03-22T16:05:24.115696Z mysqld_safe Directory '/run/mysqld' for UNIX socket file don't exists.
vector://home/bruce
root:# httpd -k start
Still no joy!  I must be missing something else!
Title: Re: mysqld
Post by: M0E-lnx on March 22, 2017, 09:56:12 am
Start all over again.
removepkg mysql
rm -rf /var/{lib,run}/mysql
slapt-get -i mysql
mkdir /run/mysqld
chown mysql:mysql /run/mysqld
mysqld --initialize --user=mysql

on
and on
and on

Title: Re: mysqld
Post by: StrayBit on March 23, 2017, 07:59:21 am
Quote
...
Executing install script for mysql-5.7.17-i686-1vl72...
groupadd: group 'mysql' already exists
useradd: user 'mysql' already exists


Remember to check the new configuration files:
/etc/rc.d/rc.mysqld.new
Done
vector://home/bruce
root:# mkdir /run/mysqld
vector://home/bruce
root:# chown mysql:mysql /run/mysqld
vector://home/bruce
root:# mysqld --initialize --user=mysql
2017-03-23T14:55:18.169282Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-03-23T14:55:18.230402Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-03-23T14:55:18.230498Z 0 [ERROR] Aborting
Should I go on
and on
and on?  ;D

Quote
vector://home/bruce
root:# /etc/rc.d/rc.mysqld restart
vector://home/bruce
root:# 2017-03-24T15:04:37.137120Z mysqld_safe Logging to '/var/lib/mysql/vector.err'.
Logging to '/var/lib/mysql/vector.err'.
2017-03-24T15:04:37.213905Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-03-24T15:04:37.967122Z mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
Thanks, MOE-lnx
Title: Re: mysqld
Post by: M0E-lnx on March 24, 2017, 06:36:35 am
This line
Quote
2017-03-23T14:55:18.230402Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
indicates the mysql data dir is not empty.  The --initialize command does not want to overwrite your data there, so see  if 'ls /var/lib/mysql/ has files in it and if so, try removing them
Title: Re: mysqld
Post by: StrayBit on March 24, 2017, 08:02:07 am
/var/lib/mysql/ did have files.  Fortunately, I made a backup copy before removing them.  DIDN'T WORK!
Tried the same with /srv/mysql/  IT WORKED!
Now to figure out where I was and continue on
and on
and on.
Title: Re: mysqld OPPS
Post by: StrayBit on March 24, 2017, 04:39:18 pm
OK!  I thought this was solved.  That was a premature thought!  (There I go - thoughting again!)
Thanks to a lot of help, MySqld and httpd are running.  Unfortunately: putting http://idlegion39///wp-admin/install.php in my browser (idlegion39 is localhost)
Quote
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
I've looked in the httpd/*.conf files but can find no instance of mysql being specified.
Title: Re: mysqld OPPS
Post by: retired1af on March 25, 2017, 06:35:30 am
The extension will be called in php.ini.

Look for: ;extension=mysql.so

Remove the semicolon, save the file and restart httpd.
Title: Re: mysqld OPPS
Post by: StrayBit on March 25, 2017, 01:44:53 pm
I don't know if this is relevant to anything
Quote
root:# find / -name 'php.ini'
find: `/home/bruce/.gvfs': Permission denied
find: `/var/lib/gdm/.gvfs': Permission denied
find: WARNING: Hard link count is wrong for `/proc/fs' (saw only st_nlink=9 but we already saw 7 subdirectories): this may be a bug in your file system driver.  Automatically turning on find's -noleaf option.  Earlier results may have failed to include directories that should have been searched.
Permission denied? to root!! I was unable to locate php.ini anywhere - not even a google search, although that did tell my where it should be as well as samples on the local system should be.
Finally, after searching for an hour, found one on the net.  After spending two hours removing half of the leading line numbers, decided it would be less error prone if I wrote a C program to remove them.  That only took a bit over an hour.  So much about programming that I have forgotten!
Putting that into public_html and restarting httpd was no joy.
Quote
root:# find / -name 'mysql.so'
find: `/home/bruce/.gvfs': Permission denied
/mnt/VL7.1/usr/lib/php/extensions/mysql.so
find: `/var/lib/gdm/.gvfs': Permission denied
find: WARNING: Hard link count is wrong for `/proc/fs' (saw only st_nlink=9 but we already saw 7 subdirectories): this may be a bug in your file system driver.  Automatically turning on find's -noleaf option.  Earlier results may have failed to include directories that should have been searched.
Should have found this 5 hours ago.  Probably would have if fstab didn't have a wrong file type!
Copied from 7.1 installation to the same location in 7.2:  It already had the extension enabled.  Still no joy!
Title: Re: mysqld OPPS
Post by: StrayBit on April 01, 2017, 12:23:09 pm
Thought I had already mentioned this:  when I send my browser to localhost (aka idlegion39), it opens the index file.  but if I try to open wp-admin/wp-install.php, I get
Quote
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
Apparently, just installing and running mysql is not enough!
I can find no place in the httpd.conf or mod_php.conf files that refers to mysql.  There several in php.ini but they seem to be setting variables.
Any suggestions?
Title: Re: mysqld OPPS
Post by: retired1af on April 01, 2017, 07:26:37 pm
Again. php.ini is where the extension will be called. You may have more than one copy floating around on your system (it happens).
Title: Re: mysqld OPPS
Post by: StrayBit on April 02, 2017, 11:33:37 am
Any idea where it is to be located?  I put this on in public_html.
Title: Re: mysqld OPPS
Post by: retired1af on April 03, 2017, 04:37:24 am
Any idea where it is to be located?  I put this on in public_html.

You put php.ini in a public facing folder?!!! No no no no no no no no. Does not belong there. No wonder it's not being read correctly.

php -i | grep "php.ini"  should tell you where it is. Generally, it's buried somewhere under /etc

Title: Re: mysqld OPPS
Post by: StrayBit on April 03, 2017, 08:28:06 am
Using the command you provided, I determined that php.ini should have been in /etc/httpd.  Moved it there.  Now getting
Quote
vector://home/bruce
root:# php -i | grep "php.ini"
PHP Warning:  PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20160303
These options need to match
 in Unknown on line 0
Configuration File (php.ini) Path => /etc/httpd
Loaded Configuration File => /etc/httpd/php.ini
Of course I'm still getting
Quote
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
Title: Re: mysqld OPPS
Post by: retired1af on April 03, 2017, 04:56:58 pm
Ensure PHP is the most current "stable". Then redo your MYSQL installation. Something in your install has a mismatch, and if I recall, the only way to fix that error is to reinstall the offending "module", which is MYSQL in this case.

Title: Re: mysqld OPPS
Post by: StrayBit on April 04, 2017, 10:29:40 am
Gslapt informs me that I have php7 installed.  I removed mysql then installed it.  I find that I have to
Quote
vector://home/bruce
root:# mkdir /run/mysqld
vector://home/bruce
root:# chown mysql /run/mysqld
vector://home/bruce
root:# mysql_safe
vector://home/bruce
root:# 2017-04-04T17:16:54.741021Z mysqld_safe Logging to '/srv/mysql/vector.linux.vnet.err'.
2017-04-04T17:16:54.746815Z mysqld_safe Logging to '/srv/mysql/vector.linux.vnet.err'.
2017-04-04T17:16:54.824741Z mysqld_safe Starting mysqld daemon with databases from /srv/mysql
^C
vector://home/bruce
If I don't mkdir /run/mysqld, mysqld complains that it can't open a socket in that directory.
No change to http://idlegion39///wp-admin/install.php.
Title: Re: mysqld OPPS
Post by: retired1af on April 07, 2017, 04:47:13 am
I just took a look at my installation and php.ini is in /usr/local/lib
Title: Re: mysqld OPPS
Post by: retired1af on April 07, 2017, 05:06:52 am
You can also use this to obtain detailed information about your php installation.

https://codex.wordpress.org/Finding_Server_Info

This will tell you if it's finding the php.ini file along with a metric crap ton of other information.
Title: Re: mysqld OPPS
Post by: StrayBit on April 08, 2017, 12:06:01 pm
Selected info
Quote
Configuration File (php.ini) Path    /etc/httpd
Loaded Configuration File    /etc/httpd/php.ini
Scan this dir for additional .ini files    /etc/php
Quote
Server Root    /usr
Loaded Modules    core mod_so http_core mod_authn_file mod_authn_core mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_core mod_access_compat mod_auth_basic mod_reqtimeout mod_filter mod_mime mod_log_config mod_env mod_headers mod_setenvif mod_version event mod_unixd mod_status mod_autoindex mod_dir mod_userdir mod_alias mod_php7
Quote
SERVER_SOFTWARE    Apache/2.4.25 (Unix) PHP/7.1.1
SERVER_NAME    idlegion39
SERVER_ADDR    127.0.0.1
SERVER_PORT    80
REMOTE_ADDR    127.0.0.1
DOCUMENT_ROOT    /home/public_html
Quote
MysqlI Support   enabled
Client API library version    mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
Active Persistent Links    0
Inactive Persistent Links    0
Active Links    0
Directive   Local Value   Master Value
mysqli.allow_local_infile   On   On
mysqli.allow_persistent   On   On
mysqli.default_host   no value   no value
mysqli.default_port   3306   3306
mysqli.default_pw   no value   no value
mysqli.default_socket   /var/run/mysql/mysql.sock   /var/run/mysql/mysql.sock
mysqli.default_user   no value   no value
mysqli.max_links   Unlimited   Unlimited
mysqli.max_persistent   Unlimited   Unlimited
mysqli.reconnect   Off   Off
mysqli.rollback_on_cached_plink   Off   Off
mysqlnd
mysqlnd   enabled
Version    mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
...
Loaded plugins    mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password
API Extensions    mysqli,pdo_mysql
Quote
PDO support   enabled
PDO drivers    mysql, sqlite
pdo_mysql
PDO Driver for MySQL   enabled
Client API version    mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
Directive   Local Value   Master Value
pdo_mysql.default_socket   /var/run/mysql/mysql.sock   /var/run/mysql/mysql.sock
You're right - there is a ton of information!
As I read this, mysql is enabled.  But why doesn't it work?
Am updating my apps seeing PHP7 is among them.  Will restart and try again.

What a startling developing revoltment!  There was no change to starting a php file.  AND I can't connect to the internet!  I can ping the router and I can access VL files from my laptop.
Title: Re: mysqld OPPS
Post by: nightflier on April 09, 2017, 04:18:00 am
What a startling developing revoltment!  There was no change to starting a php file.  AND I can't connect to the internet!  I can ping the router and I can access VL files from my laptop.

Since this should not be php related, I have some suggestions. Sounds like a DNS problem. Can you ping a public ip, like 8.8.8.8?
Title: Re: mysqld OPPS
Post by: StrayBit on April 09, 2017, 11:47:02 am
Ping -c 3 8.8.8.8 works fine.  So it must be DNS.
I'm going to down load the latest ISO and start over.