Hello FCC campers
I was trying to install MySQL with workbench on my Debian9 but I just wasn’t able to. I had to stop doing my Java Web course for this reason. The sources I used was these two ones.
I also looked into other configuration but I wasn’t able and I have been with this problem for some time. Here is pretty much what happened.
I followed these steps (which are contained in the YouTube video):
- sudo apt install mysql-server
- sudo mysql_secure_installation
- Edit and change the bind-address to 0.0.0.0 (I wasn’t able to do that, because of the next step).
4; sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf (This part should allow me to access the bind address. The thing is that is shows as if it is blank. No information or anything to alter.)
- sudo service mysql restart (Didn’t get to this part because of the #4)
- sudo mysql -u root (Didn’t get to this part because of the #4)
- ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘My Password’; (Didn’t get to this part because of the #4)
Also no error shows up on the screen. I want to know if anyone knows a solution for this? Or if this is a thing that happens on Debian9. Someone knows how to get around it?
Also the winner answer is any that can make me able to work with MySQL with Workbench on Debian 9.
Thank you in advance.
Double check the location of your config file (/etc/mysql/mysql.conf.d/mysqld.cnf) and make sure it is actually there.
Assuming that sudo did not produce any error output, meaning you’re opening mysql’s config file with super user privileges, being blank means it’s empty.
Youtube videos for the most part are giving instructions for their respective versions and those are subject to change.
That’s interesting. I just checked and there is a “mariadb.cnf” file instead of a “mysqldb.cnf” file. And inside the file I have the following information.
"# The MariaDB configuration file
The MariaDB/MySQL tools read configuration files in the following order:
1. “/etc/mysql/mariadb.cnf” (this file) to set global defaults,
2. “/etc/mysql/conf.d/*.cnf” to set global options.
3. “/etc/mysql/mariadb.conf.d/*.cnf” to set MariaDB-only options.
4. “~/.my.cnf” to set user-specific options.
If the same option is defined multiple times, the last one will apply.
One can use all long options that the program supports.
Run program with --help to get a list of available options and with
–print-defaults to see which it would actually understand and use.
This group is read both both by the client and the server
use it for options that affect everything
Import all .cnf files from configuration directory
I am not really sure how to get around this. But I will try and find something. I think you shed some light so I can find an answer.
Thank you very much Michael! Have a great day.
I was able to solve the problem. I found this tutorial on the internet that explained why I was having some problem. It seems that the folks at MySQL (I would have to check that better) designed Workbench for Mac Unix system. And for Debian you would need to allow some changes in it. I followed the steps below and it worked. This might be a case to leave this infor hanging somewhere in case someone else needs heps as well.
I don’t think this is the perfect solution but gets the job done. And I am able to work with it through the workbench so far. Here it is:
The reason is that recent Ubuntu installation (maybe others also), mysql is using by default the UNIX or auth_socket plugin.
- set root user to mysql_native_password $ sudo mysql -u root -p # I had to use “sudo” since is new installation
mysql:~ USE mysql; SELECT User, Host, plugin FROM mysql.user;
mysql:~ UPDATE user SET plugin=‘mysql_native_password’ WHERE User=‘root’;
mysql:~ FLUSH PRIVILEGES;
$ service mysql restart
- Add new db_user with you system_user(recommended)
$ sudo mysql -u root
I had to use “sudo” since is new installation
mysql:~ USE mysql;
mysql:~ CREATE USER ‘YOUR_SYSTEM_USER’@‘localhost’
IDENTIFIED BY ‘’;
mysql:~ GRANT ALL PRIVILEGES ON * . * TO ‘YOUR_SYSTEM_USER’@‘localhost’;
mysql:~ UPDATE user SET plugin=‘auth_socket’ WHERE User=‘YOUR_SYSTEM_USER’;
mysql:~ FLUSH PRIVILEGES;
mysql:~ exit; $
service mysql restart
Remember that if you use option #2 you’ll have to connect to mysql as your system username (mysql -u YOUR_SYSTEM_USER) Short further steps create database,tables,attributes, insert data MySQL Connector/J use it inside your java project connect with the path
Source from: https://www.youtube.com/watch?v=SJm91cvE_ks