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

When using Linux native AIO , are MySQL settings innodb_read_io_threads & innodb_write_io_threads used?
If settings are used with Linux native AIO, how can I determine the setting are optimal?

We are running MySql 5.5 on Redhat 7 using SSD drives
In my website, I have integrated search which uses Sphinx at backend. Everything works
fine. You can say it as a Main Search

Now I want to add another search for NEWS module only. You can say it a mini search. This
search only search records within NEWS page, whereas the

main search(mentioned above) is searching the content in all cms pages.

For my main search I have SPHINX folder on the root of my drive which has one source and
one index. Here is the content of my .conf file.

source drupal_search
                type = mysql
                sql_host = localhost
                sql_user = root
                sql_pass =
                sql_db = sc
                sql_port = 3306
              sql_query = select n.nid as ID, n.title, n.status, n.created, f.field_body_value ,
              f.bundle\ from node n \ inner join field_data_field_body f on (n.nid = f.entity_id)\
              where n.status = 1\ ;

              sql_attr_timestamp = created
              sql_attr_uint = status
              sql_field_string = bundle
              sql_attr_string = type
              sql_query_pre = SET NAMES utf8


index drupal_search
        source = drupal_search
                path = C:\sphinx5\data\drupal_search
        docinfo = extern
        charset_type = utf-8

Open in new window

Now what is the best approach to add secondaRY SEARCHnews for NEWS Module.
Can I make another .conf file?
I am using Sphinx Search in which I have simple join query which fetch results from 2 tables.

In my one table I have Column 'Fields'. 'Fields' column contain different values like 'News', 'Page', 'Blog' etc.

The searching is working fine. I just want that documents having type 'NEWS' must be shown in last.

For example:

 I search a word 'Content' and in search result I got 15 results i.e:
10 documents  with type 'Page',
2 documents  with Type 'Blog'
'3' results with type 'NEWS'
I want that records with type 'NEWS' will always rank lower.

Here is my query:

select n.nid as ID, n.title, n.status, n.created, f.field_body_value
from node n             
inner join field_data_field_body f on (n.nid = f.entity_id)
where n.status = 1;

Open in new window

Do I need to update my query or do any setting in Sphinx.conf?
$sql="SELECT * FROM users WHERE id='$id'";
$result = mysqli_query($con, $sql);
 while($row = mysqli_fetch_array($result)) {
        $firstname  =   $row["firstname"];
        $lastname   =   $row["lastname"];
        $email      =   $row["email"];
        $password   =   $row["password"];
     //   echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";

Open in new window

warnig:mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in (give me solution)
Hi Sir,

How to find  database attribute,level,hierarchy name  using AMO?

I am using a PHP based CMS which stores my content Pages in the MySQL Database. I have hundred's of CMS pages and it is growing. Now I want to add search feature in my website.
Instead of using MYSQL Full Text search  what are the alternative options which are easy to implement and the search results should be fast and relevant.

Note: When user search any keyword  I want to display the CMS page Title and some content in the search result page. And after user clicks on the page title, user will be redirected to that CMS page.

Looking forward for suggestions.

First select the range of cc code when cc code >80000 and cc code <90000 , then replace the cc code when the cc code is on the range but the cc code is based on the cc code  from table 2 then loop it based on the count column and only display cc code 1 and cc code 2. So how the mysql selection for this?

Picture 1 is my table 1
Picture 2 is my table 2
Picture 2 is my desire output
how code update image and display current image if i don't want to update the image using CodeIgniter version 2.2.6 ?
amend.phpamend.phpI dont know how to update the information to my database. I git the form done already then I dont know how to proceed to do the process. Please help me to do this. show me the code how.
I'm trying to send some data via phpMailer but I can get the input fields from the booking form.
I think it's because they've been formatted and I don't have any more ideas about how to do the job...

Basically I have the bform.php (form) filled up by the customer and on submit it's sent to the pre_booking-test.php file where the data is formatted and then sent to callback.php where 'raw' data's finally sent via phpMailer to the website admin. Someone has an idea how to 'parse' this raw data?
I'm attaching the files to make clear what is going on.
I have a  MySQL database with a date field.  I want a Trigger to pull the Weekday word out of that value and place it into another field on record creation.  I am not finding a sample of how to do so in my hunting around.  Any thoughts?  Thanks much.
hi guys,
i have four tables (sclass, studentinfo,subject,stugrade). i want to run a query to get data from these four tables. i have run the query to get the data, but the problem is i am only getting data where the tables have field in common. for example, students in (studentinfo table ) don't display if they don't have grade in (stugrade table). i want the students to display even if they don't have grade. i don't know how to apply the full outer join to accomplish this task.

please see what i have done.
	$query="select s.student_id,s.fname,s.mname,s.lname,c.class_id,c.classname,c.sectionname,u.subject_id,u.subjectname,g.period,g.Acadamicyear,g.grade,g.approvedby,g.grade_id from studentinfo s,sclass c,subject u,stugrade g where g.student_id = s.student_id AND g.classid = c.class_id AND g.subject_id = u.subject_id";
	$result = mysqli_query($mysqli, $query);

Open in new window

thanks for the help
RDWEB settings
Want to Run Set-RDSessionCollectionConfiguration –CollectionName MyCollection -CustomRdpProperty “session bpp:i:24”
What can we do to rollback to default session settings

I'm using mysql and trying to write a query that returns the month and year along with a count of the number of blog posts for that year.  I am not using WordPress, just for reference.  

Here is my query so far which returns the month and year, but I need to get the number of blog posts for each month/year combination.   I tried using the COUNT() function, but I am not getting the right counts.  It seems to be counting each individual row, but I need to count the group of rows for a given month/year.

SELECT DISTINCT CONCAT( MONTHNAME(date_created), ' ' , REPLACE(YEAR(date_created),',','')) AS post_month_year,
LOWER(MONTHNAME(date_created)) AS post_month,
LOWER(REPLACE(Year(date_created),',','')) AS post_year
FROM blog_post

Open in new window

The only columns needed should be post_id, date_created to do this it seems, I just can't get the query correct.
I am using MySQL ODBC 3.51.21 32 bit on Windows 2012 Server 64 bit.  I am connecting to a MySQL database engine  5.7 x64.
As this is in a virtual environment all of the 2012 systems are the same.

On some machines when I create the ODBC connection it will accept 'root' as the user. On others it insists on  'root@test.sys1.qqq'.  This is very difficult as I do not want to set up each computer with it's own user.

Does anyone have a solution as to why some machines want the full machine name in the login?
How do I Creating ODBC DSN Mysql Connector programmatically Not the sql server but the mysql
I have a prepare statement (php 7) I need to understand how to make.

Using this example:
            if($getData = $mysqli->prepare("SELECT val1, val2, val3, val4 from db.table where field1 like ? and field2 like ? and field3 like ?"))
                  $getData->bind_param('sss', $item1, $item2, $item3);                  
                  $getData->bind_result($val1, $val2, $val3, $val4);      

Except I won't know field1, field2, or field3....or if there just field1 and field3.  And I need to deal with the "like" scenario...just as I would this query...(this one works with one variable and one field)...

$param = "%{$_REQUEST['ans']}%";
if($getShipToInfo = $mysqli->prepare("select stid, vendor_id, name_of, address_1_of, address_2_of, city_of, state_of, zip_of, country_of from db_table where owner_of=? and " . $_REQUEST['fld'] . " like ? order by ?"))
      $getShipToInfo->bind_param('sss', $_SESSION['s_owner'],  $param, $_REQUEST['fld']);                  
      $getShipToInfo->bind_result($stid, $vendor_id, $name_of, $address_1_of, $address_2_of, $city_of, $state_of, $zip_of, $country_of);      

So, to recap...I need to be able to pass my fields AND my values to build a query.  Whether I'm passing address_2_of and city_of or any number of items.  I started by looking into call_user_func_array...but I'm still not getting it.  

Can anyone …
I insert a row in the table as follows

final SqlParameterSource namedParameters = new MapSqlParameterSource.addValue("xParam", X.getName).addValue("yParam", Y.getName).addValue("zParam", Z.getName);

I have a enum colum in the database which is of enum OrderStatusEnum

I have an enum as follows

public enum OrderStatusEnum {
    ACTIVE("A","Active Order"),
    AWAITING("I","Awaiting Order")

I want to save ACTIVE, AWAITING in the database. Also retrieve the same on query

I'm facing exception when entity is getting set as enum and saved via JdbcTemplate. Data Truncate exception


1. Do i need to save ACTIVE/AWAITING in the database or Active Order/Awaiting Order i.e enum description ??
2. How to save the enum value and not sure how to save it

If i put Types.VARCHAR as an additional parameter the value is getting saved as ACTIVE/AWAITING ORDER and seems description is getting saved

Which one is the right approach - saving enum value or description. I think saving enum value would be the right option. However unable to save the enum using the above

Hi everyone,
I need to create an INVOICE out of a booking form already existing.
When the submit button is pressed, I need to send an email to the customer in a template that I'm calling 'INVOICE'.
Actually the email is already set but the data is sent just via plain text and not html and I think as a string.
Unfortunately the booking form has been 'custom' created and the fields for collecting data are just in a form of raw data. (and I cannot get single field with $_POST...)
If someone can take a look at the code I attached and give some hints/solutions it will be great!
Also, if you need more data I'll post more files.
Cannot make joomla tags work again for my custom joomla component.
I did all steps regarding conent type adding from here
My table tableMy content type
INSERT INTO `dbasenew`.`iis_content_types` (`type_id`, `type_title`, `type_alias`, `table`, `rules`, `field_mappings`, `router`, `content_history_options`) VALUES (NULL, 'Sermon', 'com_sermonials.sermon', '{"special":{"dbtable":"#__sermonials_sermons","key":"id","type":"Sermon","prefix":"SermonsTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}} ', '', '{"common":{"core_content_item_id":"id","core_title":"name","core_state":"state","core_alias":"null","core_created_time":"date","core_modified_time":"null","core_body":"about", "core_hits":"null","core_publish_up":"null","core_publish_down":"null","core_access":"null", "core_params":"null", "core_featured":"null", "core_metadata":"null", "core_language":"null", "core_images":"null", "core_urls":"null", "core_version":"null", "core_ordering":"ordering", "core_metakey":"null", "core_metadesc":"null", "core_catid":"null", "core_xreference":"null", "asset_id":"asset_id"}, "special": {"author":"author", "scripture":"scripture", "chapter":"chapter", "verse":"verse", "when":"when", "scripture2":"scripture2"}} ', '', '{"formFile":"administrator\\/components\\/com_sermonials\\/models\\/forms\\/field.xml", 

Open in new window

I got error when running this code. The code is to process the renewal application.
We have a small library of slightly less than 1,000 books at this time but new books are added occasionaly. At the moment, all the details are held on an OpenOffice database but the data is a mess so we've refined the data and created a MySQL database and an online HTML form to enter relevant details. To make sure the data is always entered the same way, we want to use the API from to fill in the form.

The record fields are for ISBN, Book Title, Author(s), Publisher and Date of Publication.

We have search buttons for the ISBN and Book Title inputs to use either to retrieve the data from ISBNdb.

How do we attach the API to the search buttons that will retireve the relevant data and put it in the correct input fields of the form but still be able to hand fill if necessary?
Hi there,
I'm new to MySQL and PHP and I'm stuck in setting and html email in answer to a booking form.

Current status:
1)  The customer on my client platform has to complete a form and then there are 2 options for payment:
1)  ask to send an invoice;
2)  pay via card;

What I want to achieve:
At the moment for the first option my client 's receiving an email via phpMailer(set to: no html with 2 attattachment as 2 plain/text files with booking details).
The client has to go through those emails and fill up manually an invoice with this data and send all to the customer.

1)  I need to get/fetch this data from the booking form or 'db' and fill up a plain html template invoice. I can actually send this template but I don't know how to pass data to the html form. This way the client can receive the invoice already completed as they ask.

2)  For the option pay via card the person that is booking 's already receiving an email from the 'Card Payment Company' of confirmation but my client want me to send them/the customer also a receipt from us.
This receipt is a template receipt similar to the invoice template.

I need suggestions or if someone cano help me in achieve that.
Hello i am facing the same problem
"The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information."

I am attaching the php.ini file with some corrections made. Can you please rectify and tell why mysqli extension is still not getting connected.

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.