1

Background: I'm working on a school project regarding distributed database, and I'm going to use the concept of master-slave replication by virtualizing 2 CentOS on Workstation Pro. I'm going through guides on YouTube and other guides but mainly I got it from here, I have been successfully installed MySQL on both VMs and made a dummy database called with "bedrock" and created a table and populated it. I also created a user using these statements(all the things I did when I created the db and user was using the root which is from mysql -u root -p):

CREATE USER 'bedrockuser'@'localhost' IDENTIFIED BY 'IT440!abcd';
GRANT ALL ON bedrock.* TO 'bedrockuser'@'localhost';
flush privileges;

I also configured my.cnf file according to this guide but the weird thing is that there is nothing in my.cnf file when I use this command:

sudo nano /etc/mysql/my.cnf but if i execute sudo nano /etc/my.cnf I can see these on my.cnf file and which I also added stuff in it according to the guide:

[mysqld]
bind-address=12.34.56.789
server-id=1
binlog-do-db=bedrock
log-bin=/var/log/mysql/mysql-bin.log
user=mysql

symbolic-links=0
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

then I execute sudo service mysql restart and this is what I got:

Redirecting to /bin/systemctl restart mysql.service
Failed to restart mysql.service: Unit not found.

But I didnt stop there, I kept going with the guide, and the next step is to execute:

GRANT REPLICATION SLAVE ON *.* TO 'bedrockuser'@'%' IDENTIFIED BY 'IT440!abcd';

No luck and this is what I got:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'IT440!abcd'' at line 1

I dont know which part I did wrong and it would be awesome if people who are experienced with this field could help my issues. This is the first time I'm creating a distributed database with 0 guide from the Professor, so before you guys stackoverflowed me, please keep in mind that I'm just a college student who is trying my best. Thanks

Jack Rogers
  • 565
  • 7
  • 19
  • that sound more appropiated for https://dba.stackexchange.com – Juan Carlos Oropeza Dec 02 '18 at 03:52
  • *Failed to restart mysql.service: Unit not found.* means that nothing after that will work, because failing to restart the service is a fatal error. (Think about it: *The patient's heart stopped, according to the heart monitor. I ignored that issue and tried to take the patient's pulse, but got a reading of zero. I don't know what I did wrong.*) – Ken White Dec 02 '18 at 05:56

0 Answers0