November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

MySQL garbled several reasons

MySQL garbled reason is simply the following reasons:

1, it is stored in the database before garbled

2, stored in the database in the process of garbage

3, after the deposit into the database garbled

Want to know where the garbled very simple to print in the background will know.

Now that you know where […]

How to clone a MySQL database

Below shows your the steps needed to clone a MySQL database.

mysqladmin create [new db name] -u [username] –password=[password] && \ mysqldump -u [username] —password=[password] [old db name] | mysql -u [username] –password=[password] -h [host] [new db name]

How do I Export and Import a MySQL Database ?

There are times during migrations, database restores etc that you will need to export and import your MySQL database. Below shows you the commands required to achieved this.

Note : This article is meant as a reference point rather then a full blown article.

EXPORT mysqldump -u root -p {database} > db.sql IMPORT mysql -u […]

MySQL: changing the storage location for databases

By default when you install MySQL it stores databases on the C drive, you can change this during installation but perhaps you forgot to change the data files path during installation or completely missed the option to do this, or perhaps you used the Web Platform Installer which doesn’t give you any option to change […]

Mysql DataBase in linux

We can check how to install mysql db in a linux machine All files of mysql including DB are stored in /var/lib/mysql/

 

All configuration files are in /etc/my.cnf

 

Install the package using yum # yum install mysql mysql-server

 

And then start the mysql server # service mysqld start

 

Here no root […]

Mysql source

Executing number of sql queries at a time using “source” command

Make all the queries in a single file, here i opened a file called “ctechz.sql” and saved all sql queries in this file.

# mysql -uroot -pmysql

mysql> use dbname; —– be in that database and then run the “source” command to update the […]

How to take Mysql Dump

We can just check how to back up and restore mysql database and tables

 

if we want the backup of entire mysql db # mysqldump -u root -p -A > /bkp/mysql_full.sql -A —— take all(full)db from /var/lib/mysql -p —— password -u —— user

 

# vim mysql_full.sql shows the complete file db entries in […]

Mysql show

mysqlshow is another way to check the database details table and column information, let’s check some of the basic commands

shows available databases # mysqlshow -pmysql

Display all tables in a DB # mysqlshow -pmysql databasename

Display tables along with number of columns in a database # mysqlshow -v -pmysql databasename

Display columns and Rows […]

How to Recover a Mysql Root Password

Let’s check how can we recover mysql root password if we lost it Step # 1: Stop the MySQL server process. Step # 2: Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password. Step # 3: Connect to mysql server as the root user. Step # […]

Mysqladmin Tips

Here we can see some tips with mysqladmin tool To check the status of mysqld # mysqladmin -u root -pmysql ping # service mysqld status # mysqladmin -u root -pmysql status

 

To find mysql version # mysqladmin -u root -pmysql version

 

To view all the MySQL Server status variable and it s current […]