View previous topic :: View next topic |
Author |
Message |
conte n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/The Matrix/movie_the_matrix_neo.gif)
Joined: 30 Nov 2003 Posts: 46
|
Posted: Sun Mar 07, 2004 5:17 pm Post subject: creare utenti in mysql |
|
|
Salve a tutti o fatto unn bel giretto nel forum ma non trovo nulla volevo come fare per creare utenti in mysql e come fare un bind verso la scheda di rete.
Premetto sono andato nel file /etc/mysql/my.conf a modificare la voce bind
bind-address = 127.0.0.1
#bind-address = 10.0.0.2
port = 3306
solamente che facendo un nmap non vedo la porta 3306
visto che non trovo nulla nel forum pensavo che sarebbe carino metterlo tank |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Sparker l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/14879797624064996b6b89f.jpg)
Joined: 28 Aug 2003 Posts: 992
|
Posted: Sun Mar 07, 2004 8:52 pm Post subject: |
|
|
Per gli utenti devei solo dare i privilegi usando GRANT:
GRANT create,select,insert,eccetera TO utente@host IDENTIFIED BY 'password'
(ora non ricordo la sintassi corretta) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
theo_ n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_darth_maul.gif)
Joined: 11 Feb 2004 Posts: 30 Location: Vicenza - Italy
|
Posted: Mon Mar 08, 2004 6:18 am Post subject: |
|
|
Per amore della precisione i passaggi corretti per addare un utente sono i seguenti:
Code: |
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 314 to server version: 4.0.17
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> grant all privileges on nomedatabase.* to utente@host identified by 'tuapassword';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
|
Ovviamente prima di questo devi aver creato il tuo database da console con
Code: |
# mysqladmin -u root -p create nomedatabase
|
theo. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
b10m Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/BaldursGate/baldursgate_edwin.gif)
Joined: 04 Aug 2003 Posts: 204 Location: Monza
|
Posted: Mon Mar 08, 2004 7:55 am Post subject: Re: creare utenti in mysql |
|
|
conte wrote: |
solamente che facendo un nmap non vedo la porta 3306 |
Sicuro di non avere le iptables attive? Se non bindi la scheda di rete dovrebbe rendere servizio disponibile su tutte le interfacce. A me funzona senza modifiche |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
BlueRaven Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_edwin.gif)
Joined: 12 May 2003 Posts: 254
|
Posted: Mon Mar 08, 2004 11:14 am Post subject: Re: creare utenti in mysql |
|
|
conte wrote: | solamente che facendo un nmap non vedo la porta 3306 |
Ovviamente, l'nmap lo fai dalla stessa macchina, vero?
Altrimenti, essendo il MySQL in ascolto soltanto sul localhost, è un po' dura che te la faccia vedere.
A parte questo, se il bind a localhost ti serve per impedire accessi via rete, è molto più pratico inserire nel my.cnf la direttiva
sotto le opzioni relative a mysqld.
In questo modo il layer di rete non viene avviato, ma puoi ugualmente interagire col DB attraverso l'apposito socket. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
khazad-dum Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/5330444153ee7039ad0f26.png)
Joined: 26 May 2003 Posts: 148 Location: Moria
|
Posted: Mon Mar 08, 2004 10:10 pm Post subject: |
|
|
Io per creare utenti uso:
Code: |
DB = nome del database
TABLE = nome delle tabelle
PASSWORD = password dell'utente
mysql> GRANT ALL PRIVILEGES ON $DB.$TABLE TO $UTENTE@localhost IDENTIFIED BY '$PASSWORD' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
|
Ciao |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|