Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


MySQL Server





MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.

Share tech news, updates, or what's on your mind.

Sign up to Post

Could u please give a my sql expert contact number.I have some doubt.Directly i want to contact.
10 Questions to Ask when Buying Backup Software
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Hi I have below Table


UserId   Contact

A                mobile
B                 email

The user will upload CSV file having about 100- 200 userid and contact details  

After uploading the csv file ,The data should not insert into table if the userid is already exists in the Table .
I have a theoretical question around a database that I am building.

I have modelled what I am trying to do on a white board.

In summary, I have three tables which allow for the recording of accidents on site.
The tables are Staff, Visitor and Pupil.

Now, I would like to have one master table which will chronologically list each 'event' and bring in the primary key from each of the Staff, Visitor and Pupil as a foreign key in three separate columns.

What I don't know is, am I going about this the right way and also are there any pitfalls that I have not thought of with what I am trying to do.

So, I guess what I would like if it can - or should - be done, is to have each 'event' create a new row in Master as it saves with the PK as a foreign key in master.

What I can see straight away, is that I am likely to have issues around the timeline in master.

I will be building the front end with PHP Runner.

I do hope this makes some sense

Also, if anyone knows of an affordable beginners course in MySQL that is online, I would be eternally grateful.

Thanks for reading,


Whiteboard model
please provide the php code with mysql query to hide the message in an image using steganography
I need a wocommece query which can return the following:

Product ID, Product Name, Product URL, Url of Featured Image,
where wp_postmeta.meta_key = _wc_dispatch_days and wp_postmeta.meta_value > 0
stock level > 0

the meta key _wc_dispatch_days is a custom key, and it hold values, for which i need records with values >0

I am testing situtaiton which make MySQL replication broke down and I have to resume it, e.g. ONLY after the weekend we know one MySQL node down and replication is not sync across all MySQL nodes.

A->B->C->A, when C is down and B has data changed but A can't receive it.

I am reading this:

what is the correct steps to make B and A sync first before C comes online again?
 assuming B and A does not have the same content now ?
I have an older XAMPP installation hosting one website that went down. I have backups that I created using mysqldump before the crash and was wondering if I bring up a new Linux, Apache, MySQL, PHP installation would it be possible to do a restore. What should I be looking out for before rebuilding this server? If the versions of the various components are different will that affect the recovery?Thanks.
Hi experts,

I wrote this PHP code to update an analysis table on the server (Mysql) that displays monthly results from different categories.
In this example, I retrieve data from the costs table ('fin_costs') and put it into ('fin_analysis_2017')  in 2 separate rows, with the ID '16000' and '1000'.
Please find below the code.

The issue is, that this code could be written in a more efficient way and let the server do more job instead of the browser, since I see all the queries have very similar structure. So, can you advice me how I could write this code in a simpler way?

Any suggestion/ example will be highly appreciated.
Thanks in advance!
Hi experts!

I recently created a LinkedService in Azure Data Factory to copy data from an on-premises MySQL databsae to a SQL Azure database. I followed the walktrought guide in the official Microsoft Azure documentation. However, when I check the Pipeline I notice it runs with no errors, an small 5 min. duration, but none row copied. So if I got to the LinkedService definition I notice an error saying "Credenciales no establecidas" ("Credentials not set").

Any advice on what is causing this error?

Please check in attachments screenshots of the error, as well as LinkedService/Data Copy Activity definition and Pipeline runs logs.

Help will be greatly appreciated.
I have several existing tables reaching up to several million rows and I want to start adding partitioning to them. I took a smaller table with a couple thousand records as a test bed but not really sure how to perform this on existing tables.

My end goal is to create a partition for each month_year

IE: I would call the partition 2017_01 , 2017_02; etc and want data with the date range to be in each of those partitions.

Using MySQL 5.7 on a google cloud sql env.
Survive A High-Traffic Event with Percona
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Hello Experts,

How would I insert an array of data into a MySQL database, using PHP? I am able to successfully enter one row of data into each table (renters and rental_agreement), but I get confused when a renter rents more than one car seat. How do I in essence duplicate all of the necessary information into the rental_agreement table, but have the serial_number change to the next number in the series of seats rented?

Attached are three images depicting two tables and one example entry from my database.

Rental Agreement Structure
Renters Structure
Rental Agreement Example
I have the following code which inserts data into the renters table. The last_id is then inserted into the rental_agreement table. For the time being, I am using test data and not the $_POST data:

$dl_street="123 SESAME STREET";
$dl_unit=" ";
$current_street="123 SESAME STREET";
$current_unit=" ";

$sql = 'INSERT INTO `renters` 
(renters_first_name, renters_last_name, 
renters_dl_number, renters_dl_street, renters_dl_unit, renters_dl_city, renters_dl_state, renters_dl_zip,
renters_current_street, renters_current_unit, renters_current_city, renters_current_state, renters_current_zip,
renters_phone, renters_email)
 VALUES ("' . 

Open in new window


I am trying to create a batch file which executes a query on HeidiSQL.

I created a text file containing the piece of SQL which updates a table in the database. The batch job (attached as test.txt) was then created and be scheduled to run on the first of every month.

If I run test.txt  I get an error which I have also attached as BATCHERROR.png.

I am fairly new to HeidiSQL and batch jobs so spent most of my time on google trying to find a solution.

Hello Experts,

Perhaps, I am going about this incorrectly. I am open to ideas on how to do this.

I have a PHP program that generates a PDF file, dynamically using FPDF. Once the user clicks the submit button, at run time, I need to be able to do the following nearly simultaneously:
Save the PDF file in a specified location;
Grab the freshly generated PDF;
Attach it to an email; and
Send the email to specified users.

First, is this even possible?

I was thinking about using PHP Mailer in combination with FPDF.

Any ideas?

right now setup 2 x MysQL nodes in master master replication mode and is working well.

right now 3rd nodes is not working before and we clone nodes 2 and make the clone call node3 with my.cnf like this:

socket = /opt/MySQL_5_7_19/data/mysql5719.sock
server-id = 3
auto-increment-offset= 3
socket = /opt/MySQL_5_7_19/data/mysql5719.sock
port = 3306
basedir = /opt/MySQL_5_7_19
datadir = /opt/MySQL_5_7_19/data
log_bin = mysql-bin
binlog_do_db = sample
bind-address    =       #connection from all IPs allowed

Open in new window

how I break node 1 and node 2 master master replication and trying to form a circular replication mode:

nodes 1 -> nodes 2 -> nodes 3 -> nodes 1

I knew for more than 2 x MySQL nodes replication, we need this log-slave-updates=ON in my.cnf to make it works.

after I ask node 3 to point master to nodes 2 and type start slave, it gives error:

ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository

Open in new window

any reason for this and how to solve it?
I have inherited a tar.gz that is a supposed backup of a moodle installation that got deleted (the whole VM before I got here).  The tar.gz contains directories "moodle" ,  "moodledata"  and  the file "moodle.database.mysql".  There are two other tar.gz files here that one that contains the contents of the  "/var/www/html/moodle/"  directory and one contains the contents of the /var/moodledata/  directory.

Is there anyway we can reconstruct the course \ class structure in a new installation of moodle (preferred) or reconstruct the whole old installation?

Looking at Ubuntu Server 16.04 as the host OS for the new Moodle installation.

Thanks in advance!

any different between MySQL master master /active active replication and group replication ?

In master master replication and also in a circular replication mode: A-> B-> C-> A, if B die and removed, C can't receive update from A anymore and need to stop slave on C and then point to A until B is back, this means manually.

how about group replication?

or master /active active replication = group replication ?
In question
I asked to expand an query to another table.

How I can expand the same query to this table:

CREATE TABLE category (
    name VARCHAR(20),
    parent_id INT,
    CONSTRAINT fk_category_parent FOREIGN KEY (parent_id)
    REFERENCES category (id)
) engine=innodb;

CREATE TABLE category (
    name VARCHAR(255),
    parent_id INT,
   isHelp INT
) engine=innodb;


(1, 'mytext is mytext', 21,1);

Open in new window

Open in new window

how to expand the SQL to get the text from textitem with last ID and only if this text has isHelp=1? If isHelp=0 I do not want to get this in result. is this possible?
I'm receiving this error when I run the program...

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables

The array has 50 items.
My array item is $_REQUEST['itemslist'].

//I'm setting up the query types with this.
$queryTypes = array_fill(0,count($_REQUEST['itemslist']),'s');

//Building the question marks here.
$questionMarks = array_fill(0,count($_REQUEST['itemslist']),'?');

//Merging the query types with the itemslist.
$params = array_merge($queryTypes, $_REQUEST['itemslist']);

//My query
if($grabStuff = $mysqli->prepare("SELECT var1, var2, var3, var4 FROM my_table where id in (" . $param . ")"))
call_user_func_array(array($grabStuff, 'bind_param'), refValues($params));      

//The function
function refValues($arr)
$refs = array();
foreach($arr as $key => $value)
      $refs[$key] = &$arr[$key];
return $refs;

When I print the shows all 50 items.
When I print the params (with an s) I get 100 items.
I'm using php 7.

I am trying to install wordpress on my Raspberry Pi. I can install apache2 and php without a problem
When I try and install MySQL I dont get asked to change the Password after the install
Also when I try to install php5-mysql I get an error saying dependency is missing

How do I fix this so I can continue the Wordpress install
[eBook] Windows Nano Server
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Hi all

I am a Web designer, I have no more experience with PHP and mysql. I am a beginner on PHP platform I was working on bank ifsc code search engine which provides all branch details for every bank in India. I used static html to create a separate folder for each bank, state, city and branch. I have Indian banks ifsc code mysql database. how to make this on dynamically?

I want seo friendly url like this and i also want dynamically changing meta title,description and keywords

Reference link

Please help me If i am going to static it will take more time
So, I want to hone my PHP/MYSQL skills I haven't used for a while. I have a web hosting account (25 sites with this cpanel). An author of one of my PHP books says we can use PHP in a web host account. I've used phpMyAdmin for my databases in my cPanel account no worries. But I don't understand where I'd write code and run my php scripts in cPanel...?  Do I create a file structure in File Manager in cPanel?
Does any of this make sense? Please help, as I am anxious to get back in touch with my coding side :)
Hi there,
I need to create a website for a charity and am looking for suggestions on existing frameworks to use.  The system should
support  users to register and login through a web portal.  

The basic operations is that the admin will add a list of activities in a main List.  A user can check-out these activities from the main list or the admin can assign an activity to a member.

1. User registration mechanism
2. Admin dashboard/user dashboard

I am looking for a PHP/Javascript - MySQL based system.  Can you suggest any frameworks that I can customize easily.
Thank you
I have inherited a program where the date field in a MySQL table is really a VARCHAR field.  The date looks like this string:  1260777185.  I can't change the format of the field because of various reasons.  How can I change/convert this field to a date format in my query?  It needs to be done at the query level.  The field is called timestamp.  

I'm using this query, but the field is blank once the query has been run.

SELECT amount, description, STR_TO_DATE('timestamp', '%m/%d/%Y') AS transdate FROM transactions

Thank you.
How do you block an IP from visiting your site?

Can You block an IP At/with Google so Google does not show your site to an IP?

How do I do this?

now installing the MySQL 5.7.19 on redhat linux 7.2 and I do this:

/bin/mysqld --defaults-file=my.cnf --user=mysql --initialize

and see this:

installation error
any reason why and how to solve it?

MySQL Server





MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.