mysql reset root password.
Oops I can't remember my MySQL root password!
[root@centos7test etc]# mysql -u root -p
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
First we need to stop mariadb:
systemctl stop mariadb
Now we need to restart it with skip-grant-tables whic........
create database yourdbname;
Show All Databases:
Drop / Delete a MySQL Database:
drop database nameofyourdatabase;........
GRANT SELECT, LOCK TABLES ON *.* TO yourmysqluser@localhost;
All you need to do a full MySQL dump on all databases is the SELECT and LOCK TABLES privileges. This way you don't have to use the mysql root user. Data could be compromised this way but at least no harm from manipulation, changes or deletion are possible by locking down the privileges to the minimum for a full MySQL dump and backup.........
I just realized I have some blank users which I deleted butI can still login to this dummy account without a password for some reason.
mysql -u -p
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 5
Server version: 5.1.69 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation an........
This is basically URL decoding to the decimal code but nothing in PHPworks how you'd expect it.
Here are online tools to verify and check your work, it's important when querying databases with non-English characters:
Charat code for PHP:........
mysqldump: Couldn't execute 'show create table `general_log`': SHOW command denied to user 'user'@'localhost' for table 'general_log' (1142)
One of my clients almost found out the hard way, here is an unlikely situation that happened.
1.) Years ago the client had another VPS to which they backed up a BLOG nightly to an .sql file, what they forgot is that the file also contained all databases (they used the --all-databases option but forgot). So imagi........
The best way is to use rsync, I've set it up so it doesn't copy unnecessary files, or at least ones I'm sure aren't needed.
Here is the rsync command Iused (adapt to your specific Thunderbird profile location):
rsync -hazv firstname.lastname@example.org:/home/user/.thunderbird/sbrer.default/* /home/user/.thunderbird/4nyb0.default/ --exclude=global* --exclude=Cache --exclude=ImapMail --exclude=Mail
This is a great way to get your e-mail accounts going on a new c........
This may sound silly but there will be conflicts/issues with the default Centos repository so you have to use a third party like remi (I prefer not to do this but it's the only option unless you migrate your sites/data to another server or can stand some downtime-not an option IMHOon a production server).
You may need to upgrade to PHP5.3 to run Joomla or many other reasons.
Your host needs to use PHP 5.2.4 or higher to run this version of Jo........
ERROR 1045 (28000): Access denied for user 'contentmanager'@'localhost' (using password: YES)
For fun I thought I'd reset the password:
GRANT ALL ON thecontent.* TO contentmanager IDENTIFIED by 'dfdfsdfdsfsdfsd';
ERROR 1470 (HY000): String 'contentmanager' is too long for user name (should be no longer than 16)
This is ridiculous that this new version has some bizarre 16 character username limit and not only that but i........
mysql errors even though these files do exist:
110405 13:21:37 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
110405 13:26:15 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means my........
mysqldump does not include CREATE DATABASE statement
you need the --databases option
"--databases" is misleading, it implies in the documentation that this is a list of databases to be dumped, it should be clear that uses this command in conjuction with dumping a single database also adds CREATE DATABASE and is the only way to get the database to automatically create itself.........
mysqldump --all-databases > allDB.sql
The above dumps ALL the mysql databases to "allDB.sql".
If you want to compress with gzip you could do this instead:
mysqldump --all-databases > gzip > ALLDB.sql.gz........
Backup Shell Script[quote:aaa4b0b165]#!/bin/sh
mysqldump --all-databases | gzip > /var/backup/backup-$date.sql.gz
Something like that could be useful as a cronjob to locally or remotely backup your databases........
100215 07:02:24 mysqld started
/usr/libexec/mysqld: Can't read dir of '/tmp/' (Errcode: 13)
/usr/libexec/mysqld: Can't create/write to file '/tmp/ibyP1qUC' (Errcode: 13)
100215 7:02:24 InnoDB: Error: unable to create temporary file; errno: 13
100215 7:02:24 [ERROR] Can't init databases
100215 7:02:24 [ERROR] Aborting
100215 7:02:24 [Note] /usr/libexec/mysqld: Shutdown complete
Backing MySQL Databases
Backing Up/Dumping All Mysql Databases To A Single File
mysqldump --all-databases -u admin -p > allmysqldatabases.sql
The "-all-databases" clause is pretty obvious isn't it? It means that it will backup all databases.
The "-u admin" means login using the user "admin", if you h........