|
|
mySQL database information.
Full-text minimum length default is set to 4. To adjust this setting, edit /etc/mysql/my.cnf and add the following line under [mysqld]:
ft_min_word_len = 3
Next we need to restart mysql:
$ sudo service mysql restart
Last repair the full-text index on the table:
mysql> REPAIR TABLE table_name QUICK
log into mysql as root:
CREATE DATABASE lostquery
Or optionally make Character set utf8 for unicode support
CREATE DATABASE lostquery DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci;
The following command will create a user with a password and grant all privileges to the user on a particular database:
GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'passw0rd' WITH GRANT OPTION
The following command with restore a database from a backup .sql file
mysql -u username -p lostquery < lostquery-backup-2012-12-10.sql
DROP USER username@localhost
DROP DATABASE databasename
mysqladmin -u root -p processlist
GRANT SELECT, LOCK TABLES ON *.* TO backup_user@localhost;
#!/bin/bash
USER="backup_user"
PASSWORD=""
TODAY=`date +%Y-%m-%d`
OUTPUTDIR="/backup/db/$TODAY"
MYSQLDUMP="/usr/bin/mysqldump"
MYSQL="/usr/bin/mysql"
GZIP="bin/gzip"
mkdir $OUTPUTDIR
# get a list of databases
databases=`$MYSQL --user=$USER --password=$PASSWORD \
-e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
# dump each database in turn
for db in $databases; do
$MYSQLDUMP --force --opt --user=$USER --password=$PASSWORD \
--databases $db > "$OUTPUTDIR/$db.sql"
done
# compress all of the files
$GZIP $OUTPUTDIR/*
Reference: Backup multiple mysql databases into separate files
Source: https://foxhop.net/f23c51d7-2f95-11f1-a39a-e86a64d24d78/mysql
Snapshot: 2026-05-25T20:09:26Z
Generator: Remarkbox 1527ef7