MySQL(5.7) don't prompt me about root db password - mysql

Linux Mint 19.3
I want to install mySQl. So here steps:
sudo apt updat
sudo apt install mysql-server mysql-client
mysql -V
And it's success install MySQL.
npacking mysql-server (5.7.30-0ubuntu0.18.04.1) ...
Setting up libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ...
Setting up mysql-server-core-5.7 (5.7.30-0ubuntu0.18.04.1) ...
Setting up mysql-client-core-5.7 (5.7.30-0ubuntu0.18.04.1) ...
Setting up mysql-client-5.7 (5.7.30-0ubuntu0.18.04.1) ...
Setting up mysql-client (5.7.30-0ubuntu0.18.04.1) ...
Setting up mysql-server-5.7 (5.7.30-0ubuntu0.18.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.41) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
alex#nb_linuxmint:~$ mysql -V
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
But the problem is it don't ask me about root db password. So as result when I try to connect to db like this:
mysql -u root -p
Enter password:
I don't know the password.

You should run the mysql_secure installation after installing mysql_server.
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04

Related

mysql server fails to install on Ubuntu 18.04

I am trying to install mysql-server on Ubuntu 18.04. I added https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb as apt repo but when I try to install server I keep getting the below error:
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
2021-11-03T16:38:17.105736Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-11-03T16:38:17.107286Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' for error logging: Permission denied
2021-11-03T16:38:17.107308Z 0 [ERROR] Aborting
dpkg: error processing package mysql-community-server (--configure):
installed mysql-community-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 5.7.36-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Processing triggers for systemd (237-3ubuntu10.52) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
mysql-community-server
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
What I have already tried following various threads already there:
Tried purging/cleaning/removing all mysql packages multiple times. Cleaned up until dpkg -l does not list any mysql packages.
apt-get dist-upgrade

Can't Installing mysql in Linux mint 19

I am a beginner Linux user. Yesterday, I tried to install MySQL on my Linux mint laptop. I have installed Apache successfully, but I have got the following errors while trying to install MySQL.
Setting up mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (237-3ubuntu10.17) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
I have tried to find a way again from the web but nothing works and I can't sleep because of this..:(
I installed MySQL on Mint numerous times, but I recently started to have the same problem - all out of the blue.
Try the steps here:
https://vitux.com/how-to-install-and-configure-mysql-in-ubuntu-18-04-lts/
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_secure_installation
You will have a few yes and no options for your MySQL server. Choose as appropriate for you, then log in using sudo mysql, not just mysql
sudo mysql -uroot -p
The prompt will change from whatever your linux login user is to mysql>
For a list of the users automatically created:
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
Change the authentication method for root user, and assign a new password if you want:
mysql> ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Now you will be able to access MySQL server from MySQL workbench. In all honesty, I suggest to use that because it makes your life much easier.

Can't install MySQL on Ubuntu 16.04

I installed mariadb-server before installing mysql-server (which I wasn't supposed to do), so I purged mariadb* and removed it from the repos. However, I can't install mysql-server.
After sudo apt-get install mysql-server, I get:
Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ] update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ] invoke-rc.d: could not determine current runlevel
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up libhtml-tagset-perl (3.20-2) ...
Setting up liburi-perl (1.71-1) ...
Setting up libhtml-parser-perl (3.72-1) ...
Setting up libcgi-pm-perl (4.26-1) ...
Setting up libfcgi-perl (0.77-1build1) ...
Setting up libcgi-fast-perl (1:2.10-1) ...
Setting up libencode-locale-perl (1.05-1) ...
Setting up libhtml-template-perl (2.95-2) ...
Setting up libtimedate-perl (2.3000-2) ...
Setting up libhttp-date-perl (6.02-1) ...
Setting up libio-html-perl (1.001-1) ...
Setting up liblwp-mediatypes-perl (6.02-1) ...
Setting up libhttp-message-perl (6.11-1) ...
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu9) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)
After running sudo apt-get install -f, I get:
Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ] Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ] invoke-rc.d: could not determine current runlevel
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
How do I get around these errors and install mysql-server?
I got it to work by deleting all the MySQL files, which weren't deleted by apt-get purge mysql*:
sudo rm -rf /var/lib/mysql/mysql

Installation Error Mysql to Debian on BeagleBone

When logging in through mysql -u root -i, I get the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I've tried sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5, I've auto removed, cleaned, removed all associated files. After all that, I did a sudo apt-get remove --purge mysql* just to be safe. Then I installed it again: sudo apt-get install mysql-server
I get an error during the installation:
Setting up libmysqlclient18:armhf (5.5.43-0+deb7u1) ...
Setting up libdbd-mysql-perl (4.021-1+b1) ...
Setting up mysql-client-5.5 (5.5.43-0+deb7u1) ...
Setting up mysql-server-core-5.5 (5.5.43-0+deb7u1) ...
Setting up mysql-server-5.5 (5.5.43-0+deb7u1) ...
[ ok ] Stopping mysql (via systemctl): mysql.service.
[....] Starting mysql (via systemctl): mysql.serviceJob failed. See system journal and 'systemctl status' for details.
failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'm not really sure what else I can do.
So I guess the purge and installation worked. On one last whim, I decided to reboot my BeagleBone and try again. It worked.

MySQL Fails to Reinstall (Ubuntu 12.10 Server)

I'm running a Wordpress installation on an Ubuntu 12.10 server. The site was running fantastically until we had sporadic MySQL issues, where the site would "whitescreen" for a few hours, then return to normal.
Someone who should not have been toying around with the server removed MySQL to attempt a reinstall, and now mySQL refuses to reinstall. I get the following errors when running sudo apt-get install -f mysql-server from root.
Setting up mysql-server-5.5 (5.5.35-0ubuntu0.12.10.2) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
In addition, I couldn't connect to MySQL through the socket before this all happened.
Things I've tried, as recommended here/on other websites:
Restarting mysqld Deleting and (attempting) reinstallation of mysql-server
deleting all files shown when running dpkg -S etc/mysql
apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
apt-get auto cleans
apt-get with the -f flag
Numerous server reboots and restarts
Tears
Have you tried entering this through terminal/PuTTy?
apt-get install mysql-server mysql-client