service mysql-server start
. If it fails to start with a 'pre-command' failure, check the permissions of /var/db/mysql/.Check if it's actually running;What I don't get is why mysql clearly works for CQRlog but not for me as user "root" or "steve"
ps -aux | grep mysql
. If it's running and there are no failures noted in the error log then the obvious reason is likely that you're not using the correct password for those accounts.If it is not too far gone try connecting with either: 127.0.0.1 or localhost or its network IP
Also, check firewall
My suggestions may have been more suitable earlier on though.
root@ellamay:/ # mysql 127.0.0.1
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
root@ellamay:/ # mysql -u 127.0.0.1 -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
root@ellamay:/ #
It doesn't work that way;Code:root@ellamay:/ # mysql 127.0.0.1
mysql -h 127.0.0.1
select user,host from mysql.user;
. This won't show you everything but at least you can check the state of the accounts and the hosts they're allowed to login from.Check if it's actually running;ps -aux | grep mysql
. If it's running and there are no failures noted in the error log then the obvious reason is likely that you're not using the correct password for those accounts.
root@ellamay:/ # ps -aux | grep mysql
root 2036 0.0 0.1 4940 1916 1 S+ 13:05 0:00.00 grep mysql
root@ellamay:/ #
Negative.Does this mean it's running or not?
service mysql-server start
, if it fails with that pre-start
failure, check the permissions on /var/db/mysql/*. If it appears to start but still isn't running (check with ps(1)) look in /var/db/mysql/<hostname>.err for reasons why it might have failed.mysql.user;
. This won't show you everything but at least you can check the state of the accounts and the hosts they're allowed to login from.
mysql.user
does not exist!You can't check this if the database isn't running. What exactly are you looking at?Well there's the problemmysql.user
does not exist!
You can't check this if the database isn't running. What exactly are you looking at?
root@ellamay:/ # service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
root@ellamay:/ #
root@ellamay:/ # mysql_secure_installation
mysql_secure_installation: [ERROR] unknown variable 'prompt=\u@\h [\d]>\_'
Securing the MySQL server deployment.
Connecting to MySQL server using password in '/root/.mysql_secret'
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
root@ellamay:/ #
You keep trying to run before you learned how to walk.I just cannot win!!
service mysql-server start
. That should set things up for you. mysql -p
(you can find the password in the .mysql_secret file).You keep trying to run before you learned how to walk.
Start MySQL:service mysql-server start
. That should set things up for you.
Check if it's working by logging in:mysql -p
(you can find the password in the .mysql_secret file).
Change MySQL's root password; you can't do anything until you completed that step.
ls -ld /tmp /var/db/mysql/
root@ellamay:/usr/home/steve # ls -ld /tmp /var/db/mysql
drwxrwxrwt 33 root wheel 4608 26 May 14:49 /tmp
drwxr-xr-x 5 mysql mysql 1024 26 May 14:11 /var/db/mysql
root@ellamay:/usr/home/steve #
mysql_enable="YES"
mysql_args="--bind-address=127.0.0.1"
pkg info | grep -i mariadb
pkg info | grep -i mysql
So, please,
Code:pkg info | grep -i mariadb pkg info | grep -i mysql
* install mysql (pkg install)
* add the first line to rc.conf (mysql_enable) or you will get "errors"
* start mysql by
service mysql-server start
(or whatever)
If you came HERE then it's possible to go .
root@ellamay:/usr/home/steve # root@ellamay:/usr/home/steve # pkg info | grep -i mariadb
root@ellamay:/usr/home/steve: Command not found.
root@ellamay:/usr/home/steve # root@ellamay:/usr/home/steve # pkg info | grep -i mysql
root@ellamay:/usr/home/steve: Command not found.
root@ellamay:/usr/home/steve #
service mysql-server start
mysql -p
using the password in ~/.mysql_secret. mysql_secure_installation
if you really need it.That is really strange.Code:root@ellamay:/usr/home/steve # root@ellamay:/usr/home/steve # pkg info | grep -i mariadb root@ellamay:/usr/home/steve: Command not found. root@ellamay:/usr/home/steve # root@ellamay:/usr/home/steve # pkg info | grep -i mysql root@ellamay:/usr/home/steve: Command not found. root@ellamay:/usr/home/steve #
Why the obsession with mariadb? I have never installed it in my life unless it was part of an unintentional install through another program.
It's not strange, he copy/pasted the command prompt along with the commands.That is really strange.
Please check if grep is installed
The default is set to MySQL 5.7. As long as you install everything from packages then everything will depend on MySQL 5.7 and nothing will depend on MariaDB. Things are only going haywire if you do it the other way around, install mariadb then install something that depends on a mysql client. In that case MariaDB will get removed (because it conflicts with MySQL).Why mariadb check? Because it happens (all the time) exactly what you think: you install X that will require and install mariadb Y.
root@ellamay:/usr/home/steve # pkg info | grep mysql
mysql57-client-5.7.33 Multithreaded SQL database (client)
mysql57-server-5.7.33 Multithreaded SQL database (server)
root@ellamay:/usr/home/steve # pkg info | grep mariadb
root@ellamay:/usr/home/steve #
Please do
service mysql-server start
$ service mysql-server status
mysql is not running.
$ service mysql-server start
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
$