- Open & Edit
/etc/my.cnf
or/etc/mysql/my.cnf
, depending on your distro. - Add
skip-grant-tables
under[mysqld]
- Restart Mysql
- You should be able to login to mysql now using the below command
mysql -u root -p
- Run
mysql> flush privileges;
- Set new password by
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
- Go back to /etc/my.cnf and remove/comment skip-grant-tables
- Restart Mysql
- Now you will be able to login with the new password
mysql -u root -p
Related Posts:
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- Case statement in MySQL
- How do I restore a dump file from mysqldump?
- Error Code: 2013. Lost connection to MySQL server during query
- how to drop partition without dropping data in MySQL?
- 1052: Column ‘id’ in field list is ambiguous
- 1052: Column ‘id’ in field list is ambiguous
- difference between primary key and unique key
- MySQL equivalent of DECODE function in Oracle
- How to do a batch insert in MySQL
- Error: Duplicate entry ‘0’ for key ‘PRIMARY’
- What is the difference between “INNER JOIN” and “OUTER JOIN”?
- Unknown column in ‘field list’ error on MySQL Update query
- Self Join to get employee manager name
- MySQL “CREATE TABLE IF NOT EXISTS” -> Error 1050
- MySQL create table if not exists and insert record only if table was created
- How do I use properly CASE..WHEN in MySQL
- Cannot delete or update a parent row: a foreign key constraint fails
- How do I quickly rename a MySQL database (change schema name)?
- What does SQL Select symbol || mean?
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- mysql Foreign key constraint is incorrectly formed error
- What is the definition of cardinality in SQL
- MySQL: Invalid use of group function
- How can I return pivot table output in MySQL?
- Compare dates in MySQL
- MySQL syntax for Join Update
- mysql Foreign key constraint is incorrectly formed error
- Selecting data from two different tables without using joins
- MySQL: Invalid use of group function
- Simple way to calculate median with MySQL
- Creating a search form in PHP to search a database?
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- Error 1046 No database Selected, how to resolve?
- Getting “Lock wait timeout exceeded; try restarting transaction” even though I’m not using a transaction
- What is it exactly a BLOB in a DBMS context
- MySQL Error 1264: out of range value for column
- Simple Random Samples from a Sql database
- ERROR 1452: Cannot add or update a child row: a foreign key constraint fails
- What does SQL clause “GROUP BY 1” mean?
- How to SUM and SUBTRACT using SQL?
- The backend version is not supported to design database diagrams or tables
- Create mysql table directly from CSV file using the CSV Storage engine?
- Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?
- SQL select only rows with max value on a column
- MySQL – UPDATE multiple rows with different values in one query
- Postgres Error: More than one row returned by a subquery used as an expression
- SQL statement not working – “Operand type clash: date is incompatible with int’
- How to create a MySQL hierarchical recursive query?
- MySQL starts with searching issue
- Is it possible to GROUP BY multiple columns using MySQL?
- Repair all tables in one go
- Best way to test if a row exists in a MySQL table
- The used SELECT statements have a different number of columns
- importing a CSV into phpmyadmin
- Fatal error: Call to a member function query() on null
- Equivalent of explode() to work with strings in MySQL
- ERROR 1115 (42000): Unknown character set: ‘utf8mb4’
- MySQL OPTIMIZE all tables?
- MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET
- Remove Primary Key in MySQL
- Is merge statement available in MySQL
- “select * into table” Will it work for inserting data into existing table
- MySQL LIKE IN()?
- What SQL Query to do a simple find and replace
- What’s a good strategy for planning WordPress DB growth?
- Scanning Database for malicious Data
- wpdb->prepare function remove single quote for %s in SQL statment
- How to Join two tables from separate databases within WordPress
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to execute mulitple statement SQL queries using $wpdb->query?
- Query WordPress database by registered date and role
- How do I find which articles are missing a featured image in The WordPress database?
- SQL Error wp_commentmeta – incorrect table definition
- How do I get the posts within a certain year/date(with sql query)?
- Database Tables Lost Indexes? How to Recover?
- Why this query is not showing any result on wordpresss home page?
- How to get INSERT errors from $wpdb?
- SQL query to set posts in bulk based on the post content
- How can I write a formal sql query to get data from a custom table
- DB prefix not updating
- Performing CRUD operations on front end in wordpress
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- Find locations of all featured images of draft posts via SQL
- Bulk find & replace on WordPress posts/pages (minus image paths)
- How to show result of sql query in a page?
- update_option returns false in AJAX, how to debug?
- Improving performance of SQL sub-queries in WordPress
- The function is deprecated; use mysql_real_escape_string() instead
- The MySQL Connection could not be established., before it was joomla but i have change it into worpress
- WPDB delivers wrong results from complex queries
- How to change link in all posts?
- Woocommerce: Grab total revenue of a product over all orders
- Delete posts with word count less than x number of words
- SQL query : Select a thumbnail for a media
- SQL command to export post_content from wp_posts using phpMyAdmin
- SQL Query to get post_id from wp_posts and and meta_key(s) from wp_postmeta
- How do I load a sql.gz file to my database? (importing)
- Possible SQL injection. How to locate and fix?