Lampdocs.com
Documenting the Open Source
Follow us on Twitter Follow us on Facebook Follow us on Google Plus Linkedin YouTube Follow us on rss
Skip to content
  • Home
  • About
  • Administration
  • Contact Us
  • Privacy Policy
  • Search
Home  »  Directadmin • MySQL   »   How to Add MySQL Root Password for Directadmin

How to Add MySQL Root Password for Directadmin

By admin | October 15, 2010
0 Comment

Recently I had to deal with a Directadmin VPS that had mysql installed, but for some reason there wasn’t a record for root in mysql user table. Here are the queries I used to add a root account, and to assign all the necessary privilegies.

First of all We need to create a record with username and password.

INSERT INTO user(user, password) values (‘root’, PASSWORD(‘PASSWORD_HERE’));

Then we need to add all the privileges to our root:

UPDATE `mysql`.`user` SET `Select_priv` = ‘Y’,
`Insert_priv` = ‘Y’,
`Update_priv` = ‘Y’,
`Delete_priv` = ‘Y’,
`Create_priv` = ‘Y’,
`Drop_priv` = ‘Y’,
`Reload_priv` = ‘Y’,
`Shutdown_priv` = ‘Y’,
`Process_priv` = ‘Y’,
`File_priv` = ‘Y’,
`Grant_priv` = ‘Y’,
`References_priv` = ‘Y’,
`Index_priv` = ‘Y’,
`Alter_priv` = ‘Y’,
`Show_db_priv` = ‘Y’,
`Super_priv` = ‘Y’,
`Create_tmp_table_priv` = ‘Y’,
`Lock_tables_priv` = ‘Y’,
`Execute_priv` = ‘Y’,
`Repl_slave_priv` = ‘Y’,
`Repl_client_priv` = ‘Y’,
`Create_view_priv` = ‘Y’,
`Show_view_priv` = ‘Y’,
`Create_routine_priv` = ‘Y’,
`Alter_routine_priv` = ‘Y’,
`Create_user_priv` = ‘Y’ WHERE `user`.`Host` = ” AND `user`.`User` = ‘root’ LIMIT 1 ;

And the last command:

GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY ‘PASSWORD_HERE’ WITH GRANT OPTION

Then you can do the same for da_admin mysql user:

GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost IDENTIFIED BY ‘PASSWORD_HERE’ WITH GRANT OPTION;

Restart mysql and have fun.

Directadmin MySQL
add root account mysql mysql root directadmin mysql root grant privileges

Related Posts

  • How to Set Up Custom HTTPD Configuration for Yii2 on a Directadmin Server Running nginx
  • Setting Up 301 Redirect to Another Domain Name with Nginx in Directadmin
  • How to Set Custom DocumentRoot for a Domain in DirectAdmin
  • How to Set Up MySQL Master and Slave on the Same Server
Post navigation
← How to Update Directadmin Awstats for a Single Domain How to Check that a PHP Variable is a Mysql Resource →

Popular Posts

  • defaultimg Fixing Garmin Connect Bluetooth Pairing Issue with Huawei Phone
  • defaultimg Online Project Management Tools: Reviewing The Most Popular Ones
  • defaultimg Online Project Management Tools: DeskAway, Huddle and more
  • defaultimg How to Change Last Modified Date Of The File to a Time in The Past in Linux
  • defaultimg Online Project Management Tools: Customer Support Review

Recommended Software

Multimedia Tools: Backup Files on DVD

Recent Posts

  • How to Resolve Sectigo Expired on May 30, 2020 Chain Certificate Issue
  • How to get the Redeem Script for a P2SH Address From Private Key with PHP
  • How to Query an ElectrumX Server with PHP
  • How to Create Bulk Receive and Change Addresses in Electrum Console
  • How to Generate Multisig Bitcoin Addresses with the list of xpubs in PHP

Categories

  • .htaccess
  • Android
  • Apache-Nginx
  • Bitcoin
  • Businessmen
  • CPanel
  • Directadmin
  • DNS
  • E-mail
  • HTML and JS
  • Image Processing
  • Instant Messaging
  • Just For Fun
  • Linux Tricks
  • Microsoft Windows
  • MySQL
  • Payment Systems
  • PHP Configuration
  • PHP Solutions
  • Regexps
  • Security
  • Software Reviews
  • SSL
  • Time Management
  • Tomcat
  • Uncategorized
  • Web Services
  • Wordpress Ideas
  • Yii2
www.megastock.ru Here is our WMID: 165269724632