简体   繁体   中英

How to know my username and password in mysql console

i've installed mySQL .. i entered my password , but i can't remember they've asked me for a username .. is it admin or root ?

i wanna add the username and password to RubyonRails database.yml

i remember i found a command that tells me the username and password in the mysql console .. but can't find it again !

that's the part i wanna add in my database.yml

development:
 adapter: mysql
 database: myprojectname_development
 username: unknown
 password: devrailspassword
 host: localhost

Since i just started development i don't have a database yet, so there is no way of trial and error ( not that i know of )

CREATE USER 'unknown'@'%' IDENTIFIED BY 'devrailspassword';
GRANT ALL PRIVILEGES ON `myprojectname_development`.* TO 'unknown'@'%' WITH GRANT OPTION;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM