Mysql Installation Problems with 18.04

5,024

I solved this problem by going to Oracles mysql documentation on MySQL APT Repository which was a huge help, following all the instructions on the page allowed me to install mysql successfully.

What I did:

  1. Download the mysql-apt-conf tool from http://dev.mysql.com/downloads/repo/apt/
  2. Install the package using sudo dpkg -i /PATH/version-specific-package-name.deb
  3. When installing select MySQL Server & Cluster to whatever you want by pressing enter and selecting one of mysql-5.7 or mysql-8.0 then go to Ok and press enter
  4. Then sudo apt-get update(this step is required only for Ubuntu 17.10 or below)
  5. Run sudo apt install mysql-server
  6. After the main packages are installed run mysql_secure_installation, this will configure the password and other security stuff for mysql

Update

If anyone ran or had to run mysql_secure_installation withsudo, please note that you might not be able to login into mysql unless you use sudo. When this happens login to mysql console created a new user for mysql then flush all privileges. Check this question right here Connect to mysql server without sudo

Share:
5,024

Related videos on Youtube

BilboX
Author by

BilboX

Here to help

Updated on September 18, 2022

Comments

  • BilboX
    BilboX over 1 year

    I installed a fresh copy of 18.04 am installing all the packages that are required. When installing mysql-server and mysql-client I receive the following error

    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 libc-bin (2.27-3ubuntu1) ...
    Processing triggers for ureadahead (0.100.0-20) ...
    Processing triggers for systemd (237-3ubuntu10) ...
    Errors were encountered while processing:
     mysql-server-5.7
     mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    I have tried the purge, autoremove, autoclean, dist-upgrade routine but it does not work for me.

    How do I fix this problem, please help

  • Calamity Jane
    Calamity Jane about 5 years
    With that instruction I have now the error message for mysql-community-server and mysql-server Really weird. So the same error for a different package.
  • BilboX
    BilboX about 5 years
    Can you please put the error message here.
  • Calamity Jane
    Calamity Jane about 5 years
    Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. invoke-rc.d: initscript mysql, action "start" failed. ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Sun 2019-03-17 20:39:21 CET; 12ms ago Process: 12066 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
  • Calamity Jane
    Calamity Jane about 5 years
    by now I have installed, removed, deleted folders, installed again, that I cannot say, what the real status quo is by now except that it is still not running.