Skip to content

Tag Archives: mysql

rsync all your home and mysql db to new server.

14-Nov-09

Some time you may want to backup your home directory and mysql databases to a new server, we can do that using rsync script. The below script when run from your new server will, rsync all your home dir to your new server. #!/bin/bash #by-admin@serversignature.com #Old Server IP IP=192.168.0.1 #Scrit is run from the new [...]

How to change mysql time zone

07-Nov-09

How to change mysql time zone Edit /etc/my.cnf and change your time zone. root@box1 [/var/lib/mysql]# cat /etc/my.cnf [mysqld_safe] timezone = Europe/London ~ [mysqld] set-variable = max_connections=500 safe-show-database Login to mysql and check the time now. root@box1 [/var/lib/mysql]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 369 [...]

How can I tunnel a local MySQL server through SSH?

06-Nov-09

Setting up the Tunnel The most common methods of setting up a tunnel are through putty or through command-line SSH. To open an SSH tunnel via the command line, run: ssh -L3307:127.0.0.1:3306 -p 22 -N -t -x user@myhost.com Connecting with MySQL You can connect to the MySQL server! You want to choose 3307 for your [...]

Create a mysql database and User

31-Oct-09

Create a mysql database and User mysql> CREATE DATABASE database1; For creating a new user with all privileges (use only for troubleshooting), at mysql prompt type: mysql> GRANT ALL PRIVILEGES ON *.* TO ‘yourusername’@'localhost’ IDENTIFIED BY ‘yourpassword’ WITH GRANT OPTION; For creating a new user with fewer privileges (should work for most web applications) which [...]

Set mysql root password

31-Oct-09

Set mysql root password Before accessing the database by console you need to type: mysql -u root At the mysql console type: mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘yourpassword’);

Installing MYSQL with PHP4

31-Oct-09

Installing MYSQL with PHP 4 apt-get install mysql-server libapache2-mod-auth-mysql php4-mysql

Installing MYSQL with PHP 5

31-Oct-09

Installing MYSQL with PHP 5 apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

Install LAMP stack in Ubuntu

30-Oct-09

Install LAMP stack in Ubuntu As of the 7.04 release +, the Ubuntu base system includes Tasksel. You can either install LAMP using tasksel or install the LAMP packages as detailed above. sudo tasksel install lamp-server To remove the LAMP stack remove the following packages: apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libmysqlclient15off [...]