Hi guys,
So, I’ve just tried to secure my mysql connection and put a password which I read was the right thing to do.
Having said that, now I can’t actually connect to MySQL using the following command
mysql
It says I don’t have access. I’m at a loss, what to do?
The good thing is, my applications are running
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi @Remdore,
Don’t worry, you can still enter your mysql like that
mysql -u root -p
That will connect you with your root user once you provide your password.
Having said that, if you don’t want to type in your password every single time, there is a solution to the problem as well. Create a file at the following location
touch ~/.my.cnf
In the file put the following
vi ~/.my.cnf
[mysql]
user=root
password=YourPAsswordHere
That should be enough for you to be able to enter your MySQL service just by typing mysql.
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.