MySQL - PowerCram Blog

Changing root password in mysql

Changing root password in mysql http://www.cyberciti.biz/faq/mysql-change-root-password/ mysqladmin command to change root password If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows: $ mysqladmin -u root password NEWPASSWORD However if […]

MySQL Crib Sheet Cheat Sheet

To login (from unix shell) use -h only if needed.[mysql dir]/bin/mysql -h hostname -u root -p Create a database on the sql server.create database [databasename]; List all databases on the sql server.show databases; Switch to a database.use [db name]; To see all the tables in the db.show tables; To see database’s field formats.describe [table name]; To delete a […]

MySQL Backup Shell Script

***TO CREATE BACKUP SCRIPT ON LOCAL SERVERmkdir /root/binvi /root/bin/mysqlbak.sh (then copy script into this file)change parameters in script to match databasechmod 755 /root/bin/mysqlback.sh ***TO VERIFY SCRIPT WORKS1. run this command/root/bin/mysqlbak.sh2. when script is done, check subdirs of /var/backup/db/daily for tarred & gzipped backups ***TO SCHEDULE THIS TO RUN DAILY, CREATE SYMBOLIC LINKln -s /root/bin/mysqlbak.sh /etc/cron.daily/mysqlbak.sh ***TO RESTOREmysql -uUSER […]

Change MySQL root Password

How do I change MySQL root password under Linux, FreeBSD, OpenBSD and UNIX like operating system over ssh / telnet session? Setting up mysql password is one of the essential tasks. By default root user is MySQL admin account. Please note that the Linux / UNIX login root account for your operating system and MySQL root are different. […]