.my.cnf – mysql user & password

This one is for lazy ones! If you are paranoid about security, do not use this.

Create file ~/.my.cnf and add following lines in it and replace mysqluser & mysqlpass values.


For safety, make this file readable to you only by running chmod 0600 ~/.my.cnf 


Next time you run mysql commands mysql, mysqlcheck, mysqdump, etc; they will pick username & password from this file if you do not provide them as argument (-u and -p). It can save your time.

Of-course, if you specify username and password explicitly as part of commands arguments, they will be used.

Book a strategy call
with our experts

No obligation. Limited slots.

Contact Form Business Enquiry

"*" indicates required fields

Please attach any RFP, project specification, or document that you would like to share.
Drop files here or
Max. file size: 5 GB.
    This field is for validation purposes and should be left unchanged.