Mysql Code Samples



Filters


Connect to MySQL database with python mysql connector
kishore_kumar | 4 months, 3 weeks
# pip install mysql-connector

from mysql import connector
python mysql mysql-connector
Create a user table in MySQL database and insert a row
kishore_kumar | 4 months, 3 weeks
CREATE TABLE `user` (
    `username` VARCHAR(25) NOT NULL,
    `email` VARCHAR(150) NOT NULL,
mysql
Creating table using MySQLi Object-oriented Procedure
Reshma | 3 weeks, 6 days
<?php
$servername = "localhost";
$username = "username";
mysqli table creation mysql
Creating table using MySQLi Procedural procedure
Reshma | 3 weeks, 6 days
<?php
$servername = "localhost";
$username = "username";
mysqli table creation mysql
Drop table in Sql
sonia shaik | 1 month, 1 week
Drop table Table_name;
sql mysql
IFNULL in MySQL
Reshma | 3 weeks, 6 days
SELECT 
IFNULL(
  (SELECT NAME 
The result will be the name when the given id is there in the table ,Otherwise it will return NULL v
if null mysql
MySQL | DATABASE() and CURRENT_USER() Functions
Reshma | 3 weeks, 2 days
SELECT DATABASE();

SELECT CURRENT_USER();
mysql current user database
How to Get the names of the table in SQL
Reshma | 2 weeks, 3 days
SELECT * FROM INFORMATION_SCHEMA.TABLES
table names mysql
MySQL | CREATE USER Statement (creating more than one user)
Reshma | 3 weeks, 2 days
CREATE USER
'user_name' @ 'localhost' IDENTIFIED BY 'password',
'user_name' @ 'localhost' IDENTIFI
creating multiple users mysql
Changing MySQL User Password Using UPDATE Statement
Reshma | 3 weeks, 2 days
UPDATE USER SET AUTHENTICATION_STRING = PASSWORD (NEW_PASSWORD) 
WHERE USER = 'USER_NAME' AND
HOST
The FLUSH PRIVILEGES statement needs to be executed after executing the UPDATE Statement. The FLUSH
password changing using update mysql
Next