User Tools

Site Tools


mysqlnotes

MySQL Notes

<toc><ul><li><link topicref=“2”>Upgrade MySQL script</link></li><li><link topicref=“3”>Extract a single database from a dump file of all databases</link></li></ul></toc> <tt>GRANT SELECT,INSERT,UPDATE,DELETE,ALTER,INDEX,CREATE,DROP ON database.* TO user@'10.1.1.%' IDENTIFIED by 'password';</tt>

echo &quot;Starting MySQL&quot;
cd /usr/local/mysql; ./bin/safe_mysqld --user=mysql &amp;

echo &quot;Starting MySQL 4&quot;
cd /usr/local/mysql-4; ./bin/mysqld_safe --user=mysql -L ./share/mysql/english &amp;

MySQL &lt; 4.0 <strong>/etc/my.cnf</strong>:

[mysqld]
set-variable = max_connections=400
set-variable = wait_timeout=60

innodb_file_per_table

MySQL &gt;= 4.0 <strong>/etc/my.cnf</strong>:

[mysqld]
old_passwords = 1
max_connections = 400
wait_timeout = 180
skip-name-resolve
bind-address = 127.0.0.1

innodb_file_per_table

Upgrade MySQL script

#!/bin/bash

OLD=mysql-3.23.36-pc-linux-gnu-i686
NEW=mysql-3.23.58-pc-linux-i686

set -x

killall mysqld
sleep 5
cd /usr/local
rsync -axvP --update --delete --exclude=\*.err $OLD/data/ $NEW/data/
rm -f mysql
ln -s $NEW mysql
cd /usr/local/mysql; ./bin/safe_mysqld --user=mysql &amp;

Extract a single database from a dump file of all databases

sed '1,/^-- Current Database: `targetdb`$/d;/^-- Current Database: /,$d' full-Thursday.sql
mysqlnotes.txt · Last modified: 2020/02/13 22:55 (external edit)

free spam filter