mysql berechtigungen
mysql berechtigungen
Guten Abend!
Hab zwingendermassen auf meinem root mysql installiert! Mehrere datenbanken und dazugehörige benutzer angelegt! Das komische daran ist jetzt, das jeder benutzer die datenbanken des anderen sehen kann! Jetzt wollt ich mal fragen ob des normal ist? Weil es kann auch jeder benutzer die anderen datenbanken bearbeiten! Bitte kann mir vlt jemand sagen was ich da falsch mache, bzw wie ich die rechte setzen muss???
Ich sag schonmal danke für euren Rat!!!
mfg Michi
Hab zwingendermassen auf meinem root mysql installiert! Mehrere datenbanken und dazugehörige benutzer angelegt! Das komische daran ist jetzt, das jeder benutzer die datenbanken des anderen sehen kann! Jetzt wollt ich mal fragen ob des normal ist? Weil es kann auch jeder benutzer die anderen datenbanken bearbeiten! Bitte kann mir vlt jemand sagen was ich da falsch mache, bzw wie ich die rechte setzen muss???
Ich sag schonmal danke für euren Rat!!!
mfg Michi
Re: mysql berechtigungen
Dem user nur Datenbank spezifische Rechte für die jeweilige Datenbank geben.
Als globale Rechte sollten sie nur USING haben.
Als globale Rechte sollten sie nur USING haben.
Re: mysql berechtigungen
Wie genau hast Du die User und die Datenbanken erstellt?
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: mysql berechtigungen
1. hab ichs über die console mit mysql versucht, (was ich eigentlich bevorzuge)
CREATE DATABASE test;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON test.* TO 'test'@'localhost' IDENTIFIED BY 'testpass';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON test.* TO 'test'@'localhost.localdomain' IDENTIFIED BY 'testpass';
FLUSH PRIVILEGES;
danach mit dem user test einige tabellen angelegt, dann hab ich genau so einen user test2 angelegt, und der zb user test2 kann die datenbank (tabellen) des user test verändern, löschen etc...!
wie sieht denn dann der befehl aus @freddy???
2. hab auch webmin installiert (ist net so meins dieses tool)! dort kann ich auch mysql verwalten, nur läuft webmin net immer! habs auch schon versucht, nur da blick ich irgendwie garnet durch ](*,)
CREATE DATABASE test;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON test.* TO 'test'@'localhost' IDENTIFIED BY 'testpass';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON test.* TO 'test'@'localhost.localdomain' IDENTIFIED BY 'testpass';
FLUSH PRIVILEGES;
danach mit dem user test einige tabellen angelegt, dann hab ich genau so einen user test2 angelegt, und der zb user test2 kann die datenbank (tabellen) des user test verändern, löschen etc...!
wie sieht denn dann der befehl aus @freddy???
2. hab auch webmin installiert (ist net so meins dieses tool)! dort kann ich auch mysql verwalten, nur läuft webmin net immer! habs auch schon versucht, nur da blick ich irgendwie garnet durch ](*,)
Re: mysql berechtigungen
Code: Select all
CREATE USER 'test'@'localhost' IDENTIFIED BY 'passwort';
GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'localhost';
Code: Select all
GRANT USAGE ON *.* TO 'test'@'localhost';
Code: Select all
SHOW GRANTS FOR 'test'@'localhost.localdomain';
Re: mysql berechtigungen
Code: Select all
mysql -uroot
CREATE DATABASE test DEFAULT CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost' IDENTIFIED BY 'PaSsWoRd';
FLUSH PRIVILEGES;
QUIT;
Code: Select all
skip_show_database
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: mysql berechtigungen
des sagts:Joe User wrote:Und in der my.cnfCode: Select all
mysql -uroot CREATE DATABASE test DEFAULT CHARACTER SET utf8; GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost' IDENTIFIED BY 'PaSsWoRd'; FLUSH PRIVILEGES; QUIT;
Code: Select all
skip_show_database
Code: Select all
mysql> SHOW GRANTS FOR 'test'@'localhost';
+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for test@localhost |
+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '*md5pw here' |
+--------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
ok @joe, vielen dank! kann man bestehende user auch noch ändern???
Re: mysql berechtigungen
http://dev.mysql.com/doc/refman/5.1/en/revoke.htmlmichi wrote:ok @joe, vielen dank! kann man bestehende user auch noch ändern???
Re: mysql berechtigungen
So soll es eben nicht aussehen:
Lösche den User und lege ihn mit der Beschränkung auf seine Datenbank (... ON datanbank.* TO ...) erneut an. Das Gleiche machst Du auch mit den anderen Usern (ausser root). Mehr Rechte benötigen normale User nicht...
Code: Select all
... ON *.* TO ...
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: mysql berechtigungen
hab hier noch probleme... test = wer ist was lol also welcher test ist user und welcher test ist db?Freddy36 wrote:Globale Rechte sollten standardmäßig nur USAGE sein, ansonsten noch:Code: Select all
CREATE USER 'test'@'localhost' IDENTIFIED BY 'passwort'; GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'localhost';
Das tut es bei mir, deins sollte auch klappen, was sagt denCode: Select all
GRANT USAGE ON *.* TO 'test'@'localhost';
Code: Select all
SHOW GRANTS FOR 'test'@'localhost.localdomain';
GRANT ALL PRIVILEGES ON `testdb`.* TO 'testuser'@'localhost'; ... stimmen die beiden test´s soweit??
all die tests hier verwirren mich ziemlich lol!!! könntet ihr mir bitte diese codes von oben nochmal mit testdb und testuser schreiben pls??? falls net zuviel arbeit!!! danke schonmal!
PS: useradd + db add sollte so stimmen oder???
Code: Select all
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'passwort';
GRANT ALL PRIVILEGES ON `testuser`.* TO 'testuser'@'localhost'; (hier weiss ich net ob ...ON `testdb` oder eben `testuser`)
GRANT USAGE ON *.* TO 'testuser'@'localhost';
CREATE DATABASE testdb DEFAULT CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost' IDENTIFIED BY 'PaSsWoRd';
FLUSH PRIVILEGES;
QUIT;
Re: mysql berechtigungen
Code: Select all
mysql -uroot
CREATE DATABASE testdb DEFAULT CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost' IDENTIFIED BY 'PaSsWoRd';
FLUSH PRIVILEGES;
QUIT;
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: mysql berechtigungen
wie jetzt? muss ich garkein create user durchführen?
also mit grant all privileges on testdb bla testuser wird der user testuser gleich angelegt???
also mit grant all privileges on testdb bla testuser wird der user testuser gleich angelegt???
Re: mysql berechtigungen
Richtig, musst Du nicht.michi wrote:wie jetzt? muss ich garkein create user durchführen?
Ebenfalls richtig. So einfach kann es sein, wenn man die Doku liest...michi wrote:also mit grant all privileges on testdb bla testuser wird der user testuser gleich angelegt???
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: mysql berechtigungen
lol! thx...
jo hab eh auch schon bei den mysql dokus rumgelesen! aba da steht imme so scheiss viel! das man da net wirklcih durchblickt! überhaupt als nub!
na dann moi danke!!!!
jo hab eh auch schon bei den mysql dokus rumgelesen! aba da steht imme so scheiss viel! das man da net wirklcih durchblickt! überhaupt als nub!
na dann moi danke!!!!