Announcement

Collapse
No announcement yet.

mysql problem with new install of 18.04

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    mysql problem with new install of 18.04

    Have run:-
    sudo apt-get install mysql-server
    sudo /etc/init.d/mysql restart

    Using MysqlWorkbench/connect to databse.
    I have 'Local instance 3306', I get:-
    Cannot Connect to Database Server
    Your connection attempt failed for user 'root' from your host to server at localhost:3306:
    Access denied for user 'root'@'localhost'

    Obviously I've made a mistake somewhere. Any help appreciated

    #2
    That use of an init script looks odd. 18.04 uses systemd; I'd expect the init scripts to get translated to systemd, but...

    I installed mysql on 18.04 earlier this year. My notes say I installed mysql-server, mysql-client and mysql-workbench. Installing these started the mysql server; I had to stop it to restore my mysql set up from an artful (17.10) backup. To check if it's running, I can
    Code:
    $ systemctl status mysql.service
    ● mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
    Active: active (running) since Sun 2018-08-26 21:54:19 NZST; 30min ago
    Process: 6321 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
    Process: 6312 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Main PID: 6323 (mysqld)
     Tasks: 28 (limit: 4915)
    CGroup: /system.slice/mysql.service
            └─6323 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
    
    Aug 26 21:54:18 myriam systemd[1]: Starting MySQL Community Server...
    Aug 26 21:54:19 myriam systemd[1]: Started MySQL Community Server.
    For example, to restore my data from a system backup (from an artful install):
    Code:
    sudo systemctl stop mysql
    [I]copy /var/lib/mysql[/I]
    sudo systemctl start mysql
    Googling for install mysql ubuntu 18.04, sometimes it says you need to
    Code:
    sudo mysql_secure_installation
    but sometimes it implies that APT will run that script as part of installing mysql. I'm not sure what I did. I think it will set up your mysql root password.

    Anyway, I'd use the command line client "mysql" first, and use that to set up a couple of users other than root, one for "admin" and the other with your Kubuntu user name.
    Regards, John Little

    Comment


      #3
      https://www.digitalocean.com/communi...n-ubuntu-18-04

      Also, using /etc/init.d/blah as well as
      sudo service blah start|stop|restart
      still work for a few things, probably for legacy reasons

      Comment

      Working...
      X