Voglio iniziare a scrivere query in MySQL.
show grants
mostra:
+--------------------------------------+
| Grants for @localhost |
+--------------------------------------+
| GRANT USAGE ON *.* TO ''@'localhost' |
+--------------------------------------+
Non ho nessun user-id ma quando voglio fare un utente non ho privileggi, inoltre non so come fare i privilegi quando non ho nemmeno un utente!
mysql> CREATE USER 'parsa'@'localhost' IDENTIFIED BY 'parsa';
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER pr
ivilege(s) for this operation
Ho provato ad accedere come root:
mysql> mysql -u root -p;
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 'mysql
-u root -p' at line 1
mysql> mysql -u root -p root;
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 'mysql
-u root -p root' at line 1
Potrebbe essere necessario impostare un account di root per il tuo database MySQL:
Nel terminale digitare:
mysqladmin -u root password 'root password goes here'
E poi per invocare il client MySQL:
mysql -h localhost -u root -p
Potresti provare il comando di login completo:
mysql -h host -u root -p
dove l'host sarebbe 127.0.0.1
.
Fallo solo per assicurarti che la cooperazione esista.
Usare mysql -u root -p
mi permette di fare un sacco di ricerche nel database, ma rifiuta qualsiasi creazione di database a causa di un'impostazione del percorso.