Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
483 views
in Technique[技术] by (71.8m points)

ERROR 1046 (3D000): No database selected mysql Erro

enter image description here Under syntax is correct or wrong!! please help .. GRANT ALL PRIVILEGES ON summy-database.* TO 'sammy'@'localhost' IDENTIFIED BY 'password';


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think the problem is the - in the database name, in order to make that work you have to escape it with backticks.

Ex:

GRANT ALL PRIVILEGES ON `summy-database`.* TO 'ammy'@'localhost';

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...