admin管理员组

文章数量:1023773

We have a new Dell computer and want to work with mysql databases on it. In the past, we used Mysql workbench, Mysql-server and unique users on each computer, but now we want to give access to multiple users.

However, on our new computer, Fedora 40 Scientific is installed as operating system and this includes MariaDB instead of MysqlDB. How can we configure our computer and software such that more than one user can work with mysql databases on it?

We have a new Dell computer and want to work with mysql databases on it. In the past, we used Mysql workbench, Mysql-server and unique users on each computer, but now we want to give access to multiple users.

However, on our new computer, Fedora 40 Scientific is installed as operating system and this includes MariaDB instead of MysqlDB. How can we configure our computer and software such that more than one user can work with mysql databases on it?

Share Improve this question asked Nov 19, 2024 at 0:30 LaplacetransformLaplacetransform 91 bronze badge 8
  • 1 You can install MySQL on any Linux. Yum packages are available if you add MySQL's Yum repo. Instructions are here: dev.mysql/doc/refman/8.4/en/… – Bill Karwin Commented Nov 19, 2024 at 0:46
  • 1 MySQL can coexist on a server with MariaDB, provided you configure them with distinct ports, sockets, and datadirs. Alternatively, you can uninstall MariaDB. – Bill Karwin Commented Nov 19, 2024 at 0:47
  • 1 Then it's just a matter of adding users that permit remote connections. Cf. dev.mysql/doc/refman/8.4/en/creating-accounts.html – Bill Karwin Commented Nov 19, 2024 at 0:51
  • 1 I’m not sure whether you realize this: MariaDb and MySql are almost entirely compatible with each other. Various Linux distros use the MariaDb fork because it’s getting more love from its developers than MySql is from its Oracle overlords. – O. Jones Commented Nov 19, 2024 at 12:12
  • 1 @O.Jones that was true 14 years ago, when the two forked. By now the list of incompatibilities is pretty long and discrepancies started to appear even on protocol level. – Shadow Commented Nov 19, 2024 at 17:33
 |  Show 3 more comments

1 Answer 1

Reset to default 0

Make sure the MariaDB server is started up by running systemctl start mariadb.service. You can then access the MariaDB instance on the local server as the root user using sudo mariadb. If you need remote access, make sure you set bind-address=0.0.0.0 in a configuration file (usually in /etc/my.cnf.d/ for Fedora).

For each user who you want to give access to, create a new user using the CREATE USER SQL command. This gives them access to the database.

If you want to just isolate users to their own subsets of tables, you can use the CREATE SCHEMA command to create a schema for each user and then grant them permission to do what they want using the GRANT command.

For example, if I have users bob and alice and I want bob to have access to the bob_db schema and alice to have access to the alice_db schema, I'd execute the following SQL:

CREATE USER bob IDENTIFIED BY 'bob_secret';
CREATE SCHEMA bob_db;
GRANT ALL ON bob_db.* TO bob;

CREATE USER alice IDENTIFIED BY 'alice_secret';
CREATE SCHEMA alice_db;
GRANT ALL ON alice_db.* TO alice;

We have a new Dell computer and want to work with mysql databases on it. In the past, we used Mysql workbench, Mysql-server and unique users on each computer, but now we want to give access to multiple users.

However, on our new computer, Fedora 40 Scientific is installed as operating system and this includes MariaDB instead of MysqlDB. How can we configure our computer and software such that more than one user can work with mysql databases on it?

We have a new Dell computer and want to work with mysql databases on it. In the past, we used Mysql workbench, Mysql-server and unique users on each computer, but now we want to give access to multiple users.

However, on our new computer, Fedora 40 Scientific is installed as operating system and this includes MariaDB instead of MysqlDB. How can we configure our computer and software such that more than one user can work with mysql databases on it?

Share Improve this question asked Nov 19, 2024 at 0:30 LaplacetransformLaplacetransform 91 bronze badge 8
  • 1 You can install MySQL on any Linux. Yum packages are available if you add MySQL's Yum repo. Instructions are here: dev.mysql/doc/refman/8.4/en/… – Bill Karwin Commented Nov 19, 2024 at 0:46
  • 1 MySQL can coexist on a server with MariaDB, provided you configure them with distinct ports, sockets, and datadirs. Alternatively, you can uninstall MariaDB. – Bill Karwin Commented Nov 19, 2024 at 0:47
  • 1 Then it's just a matter of adding users that permit remote connections. Cf. dev.mysql/doc/refman/8.4/en/creating-accounts.html – Bill Karwin Commented Nov 19, 2024 at 0:51
  • 1 I’m not sure whether you realize this: MariaDb and MySql are almost entirely compatible with each other. Various Linux distros use the MariaDb fork because it’s getting more love from its developers than MySql is from its Oracle overlords. – O. Jones Commented Nov 19, 2024 at 12:12
  • 1 @O.Jones that was true 14 years ago, when the two forked. By now the list of incompatibilities is pretty long and discrepancies started to appear even on protocol level. – Shadow Commented Nov 19, 2024 at 17:33
 |  Show 3 more comments

1 Answer 1

Reset to default 0

Make sure the MariaDB server is started up by running systemctl start mariadb.service. You can then access the MariaDB instance on the local server as the root user using sudo mariadb. If you need remote access, make sure you set bind-address=0.0.0.0 in a configuration file (usually in /etc/my.cnf.d/ for Fedora).

For each user who you want to give access to, create a new user using the CREATE USER SQL command. This gives them access to the database.

If you want to just isolate users to their own subsets of tables, you can use the CREATE SCHEMA command to create a schema for each user and then grant them permission to do what they want using the GRANT command.

For example, if I have users bob and alice and I want bob to have access to the bob_db schema and alice to have access to the alice_db schema, I'd execute the following SQL:

CREATE USER bob IDENTIFIED BY 'bob_secret';
CREATE SCHEMA bob_db;
GRANT ALL ON bob_db.* TO bob;

CREATE USER alice IDENTIFIED BY 'alice_secret';
CREATE SCHEMA alice_db;
GRANT ALL ON alice_db.* TO alice;

本文标签: MariaDBMySQLMysql Workbench and multiple usersStack Overflow