marietto@marietto:/usr/ports/databases # pkg remove mysql57-server mysql57-client
marietto@marietto:/usr/ports/databases # pkg install mariadb105-server mariadb105-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 2 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
mariadb105-client: 10.5.15_3
mariadb105-server: 10.5.15_3
Number of packages to be installed: 2
The process will require 236 MiB more space.
Proceed with this action? [y/N]: y
[1/2] Installing mariadb105-client-10.5.15_3...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
===> Creating homedir(s)
[1/2] Extracting mariadb105-client-10.5.15_3: 100%
[2/2] Installing mariadb105-server-10.5.15_3...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
===> Creating homedir(s)
[2/2] Extracting mariadb105-server-10.5.15_3: 100%
=====
Message from mariadb105-client-10.5.15_3:
--
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc/mysql or /usr/local/etc. Sample
configuration files are provided in /usr/local/etc/mysql
and /usr/local/etc/mysql/conf.d.
The rc(8) script no longer uses /var/db/mysql/my.cnf for configuration
nor /var/db/mysql for logs and PID-file.
This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port
=====
Message from mariadb105-server-10.5.15_3:
--
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc/mysql or /usr/local/etc. Sample
configuration files are provided in /usr/local/etc/mysql
and /usr/local/etc/mysql/conf.d.
The rc(8) script no longer uses /var/db/mysql/my.cnf for configuration
nor /var/db/mysql for logs and PID-file.
This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port
marietto@marietto:/usr/ports/databases # service mysql-server start
Starting mysql.
It does not work !
marietto@marietto:/usr/ports/databases # ps ax | grep mysql
6814 0 S+ 0:00.00 grep mysql
marietto@marietto:/usr/local/www/apache24/data # sysrc mysql_enable=yes
mysql_enable: YES -> yes
marietto@marietto:/usr/local/www/apache24/data # mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none): ciao
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
That's not what I'm saying. There's nothing wrong with MariaDB, I have it set as my default.There's nothing wrong with MariaDB. WordPress works with both MySQL and MariaDB.
You're setting MariaDB 10.5 for other ports as the default MySQL database, and trying to compile Oracle MySQL; If you're setting "10.5m" you should type your make command in /usr/ports/databases/mariadb105-server/.Am I doing right here ?
Code:nano /etc/make.conf : DEFAULT_VERSION+= mysql=10.5m marietto@marietto:/usr/ports/databases/mysql57-server # make
mysql=10.5m
has NOTHING to do with building the database servers themselves. It is to make sure that ports like databases/php74-mysqli for example, are built with MariaDB 10.5 as their dependency instead of the default MySQL 5.7.marietto@marietto:/usr/ports/databases # pkg remove mysql57-server mysql57-client
marietto@marietto:/usr/ports/databases # pkg install mariadb105-server mariadb105-client
marietto@marietto:/usr/ports/databases # pkg remove mariadb105-server mariadb105-client
marietto@marietto:/usr/ports/databases # pkg install mysql57-server mysql57-client
marietto@marietto:/usr/local/www/apache24/data # pkg install mysql57-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (3 conflicting)
- mysql57-server-5.7.38 conflicts with mariadb105-server-10.5.15_3 on /usr/local/bin/innochecksum
- mysql57-server-5.7.38 conflicts with mariadb105-client-10.5.15_3 on /usr/local/bin/my_print_defa
ults
- mysql57-client-5.7.38 conflicts with mariadb105-client-10.5.15_3 on /usr/local/bin/mysql
Checking integrity... done (0 conflicting)
The following 5 package(s) will be affected (of 0 checked):
Installed packages to be REMOVED:
mariadb105-client: 10.5.15_3
mariadb105-server: 10.5.15_3
New packages to be INSTALLED:
mysql57-client: 5.7.38
mysql57-server: 5.7.38
Installed packages to be REINSTALLED:
openblas-0.3.20,1
Number of packages to be removed: 2
Number of packages to be installed: 2
Number of packages to be reinstalled: 1
The operation will free 47 MiB.
Proceed with this action? [y/N]: y
[1/5] Deinstalling mariadb105-client-10.5.15_3...
[1/5] Deleting files for mariadb105-client-10.5.15_3: 100%
==> You should manually remove the "mysql" user.
==> You should manually remove the "mysql" group
[2/5] Deinstalling mariadb105-server-10.5.15_3...
[2/5] Deleting files for mariadb105-server-10.5.15_3: 100%
==> You should manually remove the "mysql" user.
==> You should manually remove the "mysql" group
[3/5] Installing mysql57-client-5.7.38...
[3/5] Extracting mysql57-client-5.7.38: 100%
[4/5] Installing mysql57-server-5.7.38...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
===> Creating homedir(s)
[4/5] Extracting mysql57-server-5.7.38: 100%
[5/5] Reinstalling openblas-0.3.20,1...
[5/5] Extracting openblas-0.3.20,1: 100%
=====
Message from mysql57-client-5.7.38:
--
This is the mysql CLIENT without the server.
for complete server and client, please install databases/mysql57-server
=====
Message from mysql57-server-5.7.38:
--
Initial password for first time use of MySQL is saved in $HOME/.mysql_secret
ie. when you want to use "mysql -u root -p" first you should see password
in /root/.mysql_secret
MySQL57 has a default /usr/local/etc/mysql/my.cnf,
remember to replace it with your own
or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf.
marietto@marietto:/usr/local/www/apache24/data # service mysql-server start
Starting mysql.
marietto@marietto:/usr/local/www/apache24/data # service mysql-server status
mysql is not running.
marietto@marietto:/usr/local/www/apache24/data # mysql_secure_installation
mysql_secure_installation: [ERROR] unknown variable 'prompt=\u@\h [\d]>\_'
Securing the MySQL server deployment.
Enter password for user root:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
marietto@marietto:/usr/local/www/apache24/data # mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Code:
|
Code:
|
Code:
|
Enter current password for root (enter for none): ENTER Switch to unix_socket authentication [Y/n] y Change the root password? [Y/n] y Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y |
marietto@marietto:/usr/local/www/apache24/data # pkg install mariadb105-server mariadb105-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (3 conflicting)
- mariadb105-server-10.5.15_3 conflicts with mysql57-server-5.7.38 on /usr/local/bin/innochecksum
- mariadb105-client-10.5.15_3 conflicts with mysql57-client-5.7.38 on /usr/local/bin/mysql
- mariadb105-client-10.5.15_3 conflicts with mysql57-server-5.7.38 on /usr/local/bin/mysqltest
Checking integrity... done (0 conflicting)
The following 4 package(s) will be affected (of 0 checked):
Installed packages to be REMOVED:
mysql57-client: 5.7.38
mysql57-server: 5.7.38
New packages to be INSTALLED:
mariadb105-client: 10.5.15_3
mariadb105-server: 10.5.15_3
Number of packages to be removed: 2
Number of packages to be installed: 2
The process will require 47 MiB more space.
Proceed with this action? [y/N]: y
[1/4] Deinstalling mysql57-client-5.7.38...
[1/4] Deleting files for mysql57-client-5.7.38: 100%
[2/4] Deinstalling mysql57-server-5.7.38...
[2/4] Deleting files for mysql57-server-5.7.38: 100%
==> You should manually remove the "mysql" user.
==> You should manually remove the "mysql" group
[3/4] Installing mariadb105-client-10.5.15_3...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
===> Creating homedir(s)
[3/4] Extracting mariadb105-client-10.5.15_3: 100%
[4/4] Installing mariadb105-server-10.5.15_3...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
===> Creating homedir(s)
[4/4] Extracting mariadb105-server-10.5.15_3: 100%
=====
Message from mariadb105-client-10.5.15_3:
--
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc/mysql or /usr/local/etc. Sample configuration files are provided in /usr/local/etc/mysql and /usr/local/etc/mysql/conf.d.
The rc(8) script no longer uses /var/db/mysql/my.cnf for configuration nor /var/db/mysql for logs and PID-file.
This port does NOT include the mytop perl script, this is included in the MariaDB tarball but the most recent version can be found in the
databases/mytop port
=====
Message from mariadb105-server-10.5.15_3:
--
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc/mysql or /usr/local/etc. Sample
configuration files are provided in /usr/local/etc/mysql
and /usr/local/etc/mysql/conf.d.
The rc(8) script no longer uses /var/db/mysql/my.cnf for configuration
nor /var/db/mysql for logs and PID-file.
This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port
marietto@marietto:/usr/local/www/apache24/data # sysrc mysql_enable="YES"
mysql_enable: yes -> YES
marietto@marietto:/usr/local/www/apache24/data # service mysql-server start
Starting mysql.
marietto@marietto:/usr/local/www/apache24/data # mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (
2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (
2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (
2)
Enter current password for root (enter for none):
It's not. That address is just a loopback to localhost.Is 127.0.0.1 a routable IP-address ?
mysqld_enable="YES"
. hbsd likely misspelled the command, and left out the 'd' part. service mysql-server start
, it needs to return a PID of a running process. If you don't get the PID of a running process at this point, you have a problem, the server daemon is not running, and nothing is gonna work.marietto@marietto:/usr/local/etc/mysql # cat /etc/passwd | grep mysql
mysql:*:88:88:MySQL Daemon:/var/db/mysql:/usr/sbin/nologin
marietto@marietto:/usr/local/etc/mysql # chmod 444 my.cnf
marietto@marietto:/usr/local/etc/mysql # service mysql-server onestart
Starting mysql.
marietto@marietto:/usr/local/etc/mysql # ps ax | grep mysql
69466 0 S+ 0:00.00 grep mysql
It doesn't have the 'd'hbsd likely misspelled the command, and left out the 'd' part.
Check the status of mysql, make sure the server daemon is running.(mariadb is not installed) :
Code:marietto@marietto:/usr/local/etc/mysql # cat /etc/passwd | grep mysql mysql:*:88:88:MySQL Daemon:/var/db/mysql:/usr/sbin/nologin marietto@marietto:/usr/local/etc/mysql # chmod 444 my.cnf marietto@marietto:/usr/local/etc/mysql # service mysql-server onestart Starting mysql. marietto@marietto:/usr/local/etc/mysql # ps ax | grep mysql 69466 0 S+ 0:00.00 grep mysql
what else ?
I'm sure if he does that and does the installation again, the problem will be completely solved. This has happened to me over and over again and this is how I solved the problem. pkg does not remove all the files and some configurations remain. A number of remaining settings prevent MySQL or MariaDB from running.I would recommend removing the contents of /var/db/mysql/ before starting MySQL for the first time. There's been so much mucking around with different versions now, I fear the actual database files have been thoroughly thrashed. And you're starting off with an 'empty' database anyway, there's no old data to preserve.
marietto@marietto:/var/db # mv mysql mysql_
marietto@marietto:/var/db # pkg remove mariadb104-server
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):
Installed packages to be REMOVED:
mariadb104-server: 10.4.24_3
Number of packages to be removed: 1
The operation will free 214 MiB.
Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling mariadb104-server-10.4.24_3...
[1/1] Deleting files for mariadb104-server-10.4.24_3: 100%
==> You should manually remove the "mysql" user.
==> You should manually remove the "mysql" group
marietto@marietto:/var/db # service mysql-server start
mysql-server does not exist in /etc/rc.d or the local startup directories (/usr/local/etc/rc.d), or is not executable
marietto@marietto:/var/db # pkg install mysql57-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (2 conflicting)
- mysql57-server-5.7.38 conflicts with mariadb104-client-10.4.24_3 on /usr/local/bin/replace
- mysql57-client-5.7.38 conflicts with mariadb104-client-10.4.24_3 on /usr/local/bin/mysql
Checking integrity... done (0 conflicting)
The following 3 package(s) will be affected (of 0 checked):
Installed packages to be REMOVED:
mariadb104-client: 10.4.24_3
New packages to be INSTALLED:
mysql57-client: 5.7.38
mysql57-server: 5.7.38
Number of packages to be removed: 1
Number of packages to be installed: 2
The process will require 155 MiB more space.
Proceed with this action? [y/N]: y
[1/3] Deinstalling mariadb104-client-10.4.24_3...
[1/3] Deleting files for mariadb104-client-10.4.24_3: 100%
[2/3] Installing mysql57-client-5.7.38...
[2/3] Extracting mysql57-client-5.7.38: 100%
[3/3] Installing mysql57-server-5.7.38...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
===> Creating homedir(s)
[3/3] Extracting mysql57-server-5.7.38: 100%
=====
Message from mysql57-client-5.7.38:
--
This is the mysql CLIENT without the server.
for complete server and client, please install databases/mysql57-server
=====
Message from mysql57-server-5.7.38:
--
Initial password for first time use of MySQL is saved in $HOME/.mysql_secret
ie. when you want to use "mysql -u root -p" first you should see password
in /root/.mysql_secret
MySQL57 has a default /usr/local/etc/mysql/my.cnf,remember to replace it with your own or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf.
marietto@marietto:/var/db # service mysql-server start
Starting mysql.
marietto@marietto:/var/db # service mysql-server status
mysql is running as pid 8415.