Search This Blog

Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

20 December, 2016

Mysql Uninstall from Ubuntu 16.04

Follow the steps

1) sudo apt-get remove dbconfig-mysql
2) sudo apt-get remove --purge mysql-server mysql-client mysql-common

24 July, 2013

MySQL max connection status for optimisations

you can use the below query to check the max connection statistics

select version();show variables like "%max_connections%";show global status
         like "%Max_used%";show status like "%thread%";


 Max_used_connections : The maximum number of connections that have been in use simultaneously since the server started.
max_connections : The maximum permitted number of simultaneous client connections.

13 September, 2012

Importing Large MySql File Using phpMyAdmin

For importing large MySQL file using phpmyadmin follow the below procedure
i am using XAMPP, same should work with WAMP also

1) Go to the phpmyadmin folder D:\xampp\phpMyAdmin  or D:\xampp\phpMyAdmin\libraries\config.default.php
2) Open the file config.inc.php
3) find the line or insert the below line, this says the upload folder should be where we will be storing the sql file for importing
 $cfg['UploadDir'] = 'upload';
4) Create a folder  ‘upload'  in C:\xampp\phpMyAdmin

Now we can place large sql file, created using mysqldump or mysql export. I had placed a sql file with file name test-db-dump.sql

5) Now go the DB through phpMyAdmin and click on the import tab as seen below,



 
  In the combo box you can see the file we copied,  Now  hit the Go button in the bottom of the page, it will import the whole sql file to your database.


NOTE:
If you get the below error
 Fatal error: Maximum execution time of 300 seconds exceeded in

Edit the phpMyAdmin\libraries\config.default.php
$cfg['ExecTimeLimit'] = 300;


change the 300 to 1000 or more






24 August, 2012

Trimming all fields in MySQL database

UPDATE `table1` SET `tbl_column1`= trim(`tbl_column1`);

The above SQL query  will trim all the fields in the tbl_column1


05 August, 2012

enabling or disabling MySQL log

To see the current status of mysql log, type the following command in XAMPP
SHOW VARIABLES LIKE  'general_log';

below output will come in the phpmyadmin
Variable_nameValue
general_logOFF
To enable the log, type
SET GLOBAL general_log = 1;
Disabling log
SET GLOBAL general_log = 0;


To check where is the log file saved 
 SHOW VARIABLES LIKE  'general_log_file';

Below output will come
Variable_name    Value
general_log_file    \xampp\mysql\data\dino-laptop.log

 
The log files will be saved in the above mentioned path
 

03 June, 2012

mysql exporting or dumping stored procedures using mysqldump

For exporting stored procedure function and triggers using mysqdump use the following command in mysql command prompt

mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt <database_name> > output_sp_dump.sql

tmux enabling mouse interaction

Add the below line to the ~/.tmux.conf setw -g mouse on save the file and exit from the tmux shell, you should be able to use your mouse to ...