Tag Archives | MYSQL

How to reset MariaDb root password on Linux

You forgot or you unknow your root MYSQL password! How to reset MariaDb root password on Linux? Step 1: stop MariaDb Result: Step 2: Result: Step 3: stop and start Mariadb service Note: You can’t use command service mysql restart

Read full story Comments { 0 }

How to connect Mysql server through SSH tunnel using AutoSSH

Read this tutorial first: How to create SSH tunnel on Windows by using AutoSSH In step 8, we use the command like: Now, all traffic on local port 1081 will be forwarded to the SSH server on port 3306 (port MYSQL service). The PHP code for test: Result:

Read full story Comments { 1 }

How to install Mtop (MySQL top) in CentOS

mtop (MySQL top) monitors a MySQL database showing the queries which are taking the most amount of time to complete. Features include ‘zooming’ in on a process to show the complete query and ‘explaining’ the query optimizer information. Step 1: Install RPMForge on CentOS For Centos 5: How to Install RPMforge yum repository on CentOS […]

Read full story Comments { 0 }

Centmin Mod: Install Phpmyadmin

Step 1: Step 2 If you get the error: You can download it here Result: Step 3 Now you can access phpmyadmin via address: https://tutorialspots.com/6936_mysqladmin27567/ Important note: you only access via server_name defined main hostname in virtual.conf and not via ip access If you see error 404 not found, please check file /etc/csf/csf.conf Must place […]

Read full story Comments { 0 }

PHP & MYSQL: Anti Sql Injection with mysql_real_escape_string function

Mysql command will be: Mysql command will be: With this command will cause one user login without the correct password. => use mysql_real_escape_string to prevent the following: Mysql command will be: Notice: you should use function getEscaped below instead of mysql_real_escape_string

Read full story Comments { 0 }
PHP MYSQL: list of Timezones, Set Timezone

PHP MYSQL: list of Timezones, Set Timezone

Recently I needed to check the time zone in one of my applications, because it is accessed from multiple locations in United States and soon will be accessed from other countries. The first step was to get an organized list of timezone in PHP. I found an interesting article that shows all Time Zones in […]

Read full story Comments { 0 }

Maxlength of MySQL TEXT Data Types

Data types and range of data management system MySQL database (Read more) TEXT Data Types in MySQL CHAR CHAR data type for storing a data string of fixed length. It may contain characters, numbers and special characters. The fixed length defined in parenthesis, and always reserve space for this length but not in use. For […]

Read full story Comments { 0 }
PHP: retore big MYSQL-database

PHP: retore big MYSQL-database

This tutorial shows you how to restore a big MYSQL-database. Step 1: split MYSQL file into many part We use PHP-script below (ex: split.php) After run this PHP-script, we take a list of many MYSQL files: 1.sql, 2.sql … Step 2: restore MYSQL There are many ways to restore MYSQL, like BIGDUMP, MYSQLDUMPER. Here, I […]

Read full story Comments { 0 }
Change root password MYSQL in Kloxo via SSH

Change root password MYSQL in Kloxo via SSH

Step 1: Login VPS or dedicated server using SSH. Step 2: Open SSH console. Step 3: Use following commands: service mysqld stop mysqld_safe –skip-grant-tables & mysql -u root mysql> mysql> use mysql; mysql> UPDATE user SET Password = PASSWORD (‘yournewpassword’) WHERE User=’root’; mysql> FLUSH PRIVILEGES; mysql> quit; service mysqld start [root@localhost ~]# service mysqld stop […]

Read full story Comments { 1 }
PHP & MYSQL: Determine Auto Increment value of a table

PHP & MYSQL: Determine Auto Increment value of a table

How to Determine Auto Increment value of a table MYSQL Method 1: Code PHP: Result: 84586 #Showing rows 0 – 0 ( 1 total, Query took 0.0009 sec) Method 2: Code PHP: Method 3: Method 4: Method 5: You must increase the value by one. Method 6 (same with method 5): Method 7: Result: CREATE […]

Read full story Comments { 0 }