Results > Posts Filed Under > Mysql

Install Mysql from source, Compile mysql source

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure –prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db –user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe –user=mysql &
—-
yum install ncurses-devel
yum install gcc gcc-c++
libxml2-devel
libxml2-utils
make clean
Follow this command by typing;
#./configure –prefix=/usr/local/mysql –localstatedir=/home/system/data/mysql –disable-maintainer-mode –with-mysqld-user=mysql –enable-large-files-without-debug (enter)
Sit back and wait for a while while configure does its thing, once the system returns the prompt …

Mysql tips, set mysql variables, mysql Locks, mysql variables

Lock database
==============
FLUSH TABLES WITH READ LOCK;
lock all the tables of a single database or to lock a particular table
lock tables db.* read;
UNLOCK TABLES;
FLUSH TABLES WITH READ LOCK; do not quit the mysql shell else you will lose the lock
LOCK TABLES t1 WRITE, t2 READ;
LOCK TABLES explicitly acquires table locks for the current client session. Table locks can be acquired for base tables or (as of MySQL 5.0.6) views. You must have the LOCK TABLES privilege, and the SELECT privilege for …

Mysqladmin Commands, Mysqladmin Useful Commands

mysqladmin is a client for performing administrative operations. You
can use it to check the server’s configuration and current status,
create and drop databases, and more.
Invoke mysqladmin like this:
shell> mysqladmin [options] command [command-options] [command [command-options]] …
mysqladmin supports the following commands:
· create db_name
Create a new database named db_name.
· debug
Tell the server to write debug information to the error log.
· drop db_name
Delete the database named db_name and all its tables.
· extended-status
Display the server status variables and their values.
· flush-hosts
Flush …

Basic mysql commands and mysql basics

mysql -u root db_name < file.sql
Dump a Database (with special characters):
mysqldump -Q –add-drop-table db_name > file.sql
Dump a Database, 4.0 compatible:
mysqldump –compatible=mysql40 –add-drop-table –quote-name db_name > file.sql
Dump Multiple Databases:
mysqldump -Q –add-drop-table –databases db_name1 db_name2 > file.sql
Restore Multiple Databases (must be done as root):
mysql -u root < file.sql
Log into MySQL prompt as the user (or root):
mysql -u username -p
Show Databases: (will only show databases the user has access to. Root has all.)
show databases;
Drop a …

 Page 2 of 2 « 1  2