MySQL Server

46K

Solutions

60

Articles & Videos

22K

Contributors

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

ClickHouse in a General Analytical Workload
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
0
On Demand Webinar - Networking for the Cloud Era
LVL 8
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Have few queries related to MYSQL had google but did not got proper answer for the same.
1> There are three tables say A,B,C inter linked with each other .i.e A.id =B.a_id , B.id=c.b_id
Now if There sequential is insertion in A with ID "100" and then B but while inserting in C there is some issue and there is rollback so Does all record or A and B are revoked. If No then how does it follows Rollback facility. If yes then if there is insertion A then what would be its auto incremented value will it be 101 or 100 as previous 100 records is rollback.

2> These three table has huge data (2,000,000 + records in each table ) with paid and unpaid(how did just window shopping + who put the products in wish list ) user based on order no . I would say similar to AMAZON and i have to provide daily report of Paid user and unpaid user to mgmt. what method i have to use will it be plain mysql or some thing like hadoop or some other method has to be used.
Please guide as its taking huge time to fetch data all tables are normalized.
0
If I have names in a database that are found when users go to a page to search for names in my database - how can I get Google to also search the database for the same names - so they can show up in a Google search?

Pages re in PHP and data is in MySQL.

Or is it not possible?
0
DELIMITER $

CREATE PROCEDURE EXCEPTIONHANDLER (IN P_STUDENT_ID INT)

BEGIN
    DECLARE NOTEXISTS INT;

    BEGIN
    SELECT STUDENT_ID INTO NOTEXISTS
    FROM STUDENT
    WHERE P_STUDENT_ID = STUDENT_ID;
    IF NOTEXISTS != 15
    THEN SIGNAL SQLSTATE '45000'
    SET MESSAGE_TEXT = 'NO STUDENT_ID FOUND';
    END IF;
    END;

END$

DELIMITER ;


Hi. I want to create a stored procedure that shows a message when I put an ID which does not exist in student table. With the code above, when I call the procedure with the ID 15, as I put in the code, I do not get the message because I have ID 15. But when I call the code for the IDs that already exist in the student table, I still get the message. It shows that the code only works for the ID that I entered in the code (like 15). So, how can I make it work for all IDs?
0
See my below code.

$query_rs_media_new_group = "SELECT supplier_code, title, url, description, description_item, brand, type, weight, category, section, width, label_artwork, min(id) as id 
							 FROM media_new 
							 WHERE media_binder = '1'
							 GROUP BY title 
							 ORDER BY brand";
$rs_media_new_group = mysql_query($query_rs_media_new_group, $conn_cmyuk) or die(mysql_error());
$row_rs_media_new_group = mysql_fetch_assoc($rs_media_new_group);
$totalRows_rs_media_new_group = mysql_num_rows($rs_media_new_group);

Open in new window


The order by brand is not coming out in the correct order. Could this be something to do with the alias or group by?
0
The user provides my vb.net code with a SQL query that would look like this  for example:

select DISTINCT *from employees a INNER JOIN orders b on b.[Employee ID] = a.ID

I want to find a way to populate the datatable I create in code with the query columns and information but not actually get data. Is there a way to do this? The code also accepts queries from MySQL, MS Access, CSV as well as SQL.
0
I plan on purchasing a custom app that will utilize MySQL.  Does anyone know of some good training resources for training?  I'm open to in-person or web based.
0
I have seen some of the examples we have for pivot and unpivot in mysql,where the rows and columns are changes accordingly, but i have a table like below

 table1

Month    Current            30 Days       30 - 60 Days
Apr-13   1375159316       34511076         6423821
May-13   71398540         5674629          4775687
Jun-13   1314130060       27364660         9328588

and want it to create a new table like below

table2

Month            Apr-13               May-13              Jun-13
Current         1375159316      71398540     1314130060
30 Days         34511076        5674629          27364660
30 - 60 Days     6423821       4775687         9328588

How can i achieve the above.
0
Hi

I have a datatable and want that datatable to upload in a table in mysql. I have used bulkupload in sql, need to know how we can do the same using MySqlBulkLoader.

I dont want to give each and every column name of the table while upload and neither want to convert the datatable to cvs format.

Is there a way i can directly bulk upload using mysql from datatable directly?
0
Hi,

I need little help with the query.
i.e I've following  table with products data:
id, store_id, title, price, is_store_own_product

Followng is the scenerio:

Stores can have their own products as well as other products. With each product we have boolean field "is_store_own_product" which shows its store own product also there can be 1 store selected all the time:

Now, I need to show all products for selected store i.e where (store_id = current_store_id AND is_store_own_product=0 or is_store_own_product=1) but also want to show other store products that are not their own i.e where (store_id <> current_store_id AND is_store_own_product=0).

I tried with "NOT IN" but its taking lot of time.

I hope this make sense.

Thanks a lot.
0
Windows Server 2016: All you need to know
LVL 1
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Hi experts.

I am coding a login system, However when I submit a registration form it just won't save the data into the database. im sure all my code is valid and can't seem to find the reason why??

no error messages are displayed and I have tested connection to the database and it connects fine.

I have set some code to echo "USER REGISTERED" if the data was submitted and stored in the database successfully but I can't get that message to show so there must be something im missing.

Please see code below, If you have any suggestions or spot any errors please let me know. Thanks.

login.php

<?php

// includes original html for login page
include('includes/header.php');
include('includes/login_form.php');
include('includes/footer.php');

/*
$sql = "select * from users"; // Pull user info from Database.
$result = query($sql);
confirm($result);
$row = fetch_array($result);

echo $row['username']; // Get username from database.
*/

?>

Open in new window


register.php

<?php

// includes original html for Create Account page
include('includes/header.php');
include('includes/create_account_form.php');
include('includes/footer.php');

?>

Open in new window


header.php

<?php include("functions/init.php"); // includes all code for login  
?>

<!DOCTYPE html>
<!------------------------------------------------------------------------------------------
WARNING!
Copyright (C) Mike Z Moore - All Rights Reserved
Unauthorized copying of this file, via any medium is 

Open in new window

0
Deploying MySQL in production
Join Percona’s Senior Operations Engineer, Daniel Kowalewski as he presents Deploying MySQL in production on Thursday, June 22, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). Register Here: http://hubs.ly/H07QN1h0
0
I want to create a stored procedure. When I search on student_id and if it does not exist, I need to set an “out_msg” parameter as “No Student ID Found”.
Secondly, I want to create an insert statement to insert student information ( INSERT INTO STUDENT (STUDENT_ID, NAME, GENDER) values (5,'x','M'); )   into student table. If the student_id already exists, I need to handle exception “1062” Duplicate entry found and set “out_msg” OUT parameter with a meaningful message.
Input and Output parameters are
 IN        STUDENT_ID INT
,OUT    OUT_MSG VARCHAR(100)
Any help, please?
0
Percona XtraDB Cluster, Galera Cluster, MySQL Group Replication
Join Percona’s MySQL Practice Manager Kenny Gryp and QA Engineer, Ramesh Sivaraman as they present Percona XtraDB Cluster, Galera Cluster, MySQL Group Replication on Wednesday, June 21, 2017 at 10:00 am PDT / 1:00 pm EDT (UTC-7). Register here: http://hubs.ly/H07QMYT0
0
My sample site URL : My working Site URL

I am trying to find a solution that will allow me to plot the GPS coordinates of many moving objects "live" on a Google Map.

The GPS coordinates of each object will constantly be updating into a MySQL database, and I'd like to know whether it is possible to read each updated coordinate, maybe once every couple of seconds, and re-plot the marker coordinates on the Google Map, without the user having to refresh the page.  Can this be done,?

would it also be possible to make each marker different, and each marker clickable to get more information on the particular object?

My map based on Jack Dougherty's FusionTable-Map-2-layers Template and running nicely on my hostgater server.

I have Traccar Open Source GPS Tracking Platform hosted with Amazone AWS and able to get tracker data to the mysql database, this database update every 30 second with live tracker data

# my db name “newTraccar” & all tracker data update for table `positions`

// -------------- Table structure for table `positions` ---------------------//

CREATE TABLE IF NOT EXISTS `positions` (
  `id` bigint(20) NOT NULL,
  `address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `altitude` double DEFAULT NULL,
  `course` double DEFAULT NULL,
  `latitude` double DEFAULT NULL,
  `longitude` double DEFAULT NULL,
  `other` 

Open in new window

0
DELIMITER $
CREATE FUNCTION MAXSCOREID(START_STUDENT_ID INT, END_STUDENT_ID INT)
RETURNS INT
BEGIN
DECLARE STUDENT_ID INT;
BEGIN
      SELECT MAX(SCORE) INTO STUDENT_ID
      FROM STUDENT ST, SCORE S
      WHERE ST.STUDENT_ID = S.STUDENT_ID
      AND ST.STUDENT_ID BETWEEN 1 AND 10;
END;
RETURN student_id;
END$
DELIMITER ;

Hi. With the function above, I get the higher score but I want to get the student`s id who has the max score.  Any help, please?
0
Can you please tell me where the error is?
screenshot.PNG
INSERT INTO `coffee` (`id`, `name`, `type`, `price`, `roast`,

`country`, `image`, `review`) VALUES
(1, 'Cafe au Lait', 'Classic', 2.25, 'Medium', 'France',

'Images/Coffee/Cafe-Au-Lait.jpg', 'A coffee beverage consisting strong

or bold coffee (sometimes espresso) mixed with scalded milk in

approximately a 1:1 ratio.'')'
0
while using php code for each month and date .....why cant we use "if condition" or any other looping condition
0
I have mysql table named "sheet" and column name is "cep" which is varchar (50)

I want to add "0" as a prefix to the "cep" which reserves mobile numbers for me,

what is the correct mysql statement for that?

what I want to do is to concatenate "0" + "cep column" with a mysql

how can I do that?
0
Webinar: Choosing a MySQL HA Solution
LVL 2
Webinar: Choosing a MySQL HA Solution

Join Percona’s Principal Technical Services Engineer, Marcos Albe as he presents Choosing a MySQL High Availability Solution on Thursday, June 29, 2017 at 10:00 am PDT / 2:00 pm EDT (UTC-7).

Hi -
I have a table with time card type data -
I need help creating a trigger for two specific fields in the table (start_time, end_time) that will not allow the fields to be updated once they have values in them -
The process is that a 'record' is inserted into the table for a specific task with empty start and stop datetime fields -
The start and stop fields are updated using a form when the task is started and finished -
I do not want the user to be able to use the form again to 'change' the start and finished times -

This is my first attempt at creating a trigger and I have spent way too many hours trying to figure out how to make this work :-)

Any and all help gratefully appreciated -
Richard
0
Hi Experts

Could you point the correct way to format a MySQL query to obtain data between 02 dates accordingly to:
img002
What I tryed with no success:

SELECT DATE_FORMAT(_updated,'%Y-%m-%d %h-%p') as _datetime, _number, _callback, _causeid FROM meeta_callback.incomingcall_history where _updated between '2017/06/01 12:00 00:00:00' and '2017/06/14 12:00 23:59:59' order by DATE_FORMAT(_updated,'%Y-%m-%d %h-%p'),_callback

Open in new window


Thanks in advance!
0
Hi Experts

Could you point a way to generate an Excel chart and PDF File by using  Fusioncharts ?

After the grid is formed, accordingly to:
img001
I need to generate an Excel chart with its content.

Thanks in advance.
0
Hi,

I'm trying to use the following php to post multiple rows from a form to a table via an insert query ...

if ((isset($_POST['submit1']))
			&& (!empty($_POST['supplier']))
            && (!empty($_POST['sku']))
            && (!empty($_POST['unitsRequired']))
			&& (!empty($_POST['unitsReceived']))
			&& (!empty($_POST['receipt']))
				

            ) 

            {
        
            // YES, THE DATA HAS BEEN POSTED, NOW ESCAPE IT FOR USE IN A QUERY
	    $supplier 			= $mysqli->real_escape_string($_POST['supplier']);
            $SKU 				= $mysqli->real_escape_string($_POST['sku']);
            $unitsRequired 	= $mysqli->real_escape_string($_POST['unitsRequired']);
	   $unitsReceived 		= $mysqli->real_escape_string($_POST['unitsReceived']);
	   $receiptedBy 		= $mysqli->real_escape_string($_POST['receipt']);
				
        
            $sql = "INSERT INTO goodsIn (supplier, SKU, unitsRequired, qtyReceived, receiptedBy) VALUES ('$supplier', '$SKU', '$unitsRequired', '$unitsReceived', '$receiptedBy')";
            if (!$res = $mysqli->query($sql)) trigger_error( $mysqli->error, E_USER_ERROR );

            }

Open in new window


The php only runs when the results in the form (this varies depending on the search criteria which produces the form) contain 1 row of data when 2 or more are present the process fails.

Where do I introduce a while loop in the code to accomodate this?

Hope this makes sense?

J
0
Follow on question to  recent support from LajuanTaylor.

I am using the "mysql community installer" to install mysql and mysql workbench on a windows 7 pc. All components appear to install correctly. The workbench launches but does not succeed in connecting with the mysql server.   See embedded file below

status of connection between workbench and mysqlserver
I have tried to start the server from the workbench, but this has failed. See two images below

atttempt to connect part 1attempt to connect part 2
The following is a status from the community installer showing what has been installed. Seems to be ok ?

community installer status - looks ok ?
Appreciate someone taking a look and hopefully identifying the stupid mistake I am making

PS - I have several other installations on windows 10 pcs which work perfectly. Hopefully its not a windows 7 problem !!
0
After upgrading MySQL to version - 5.7.18, we are continuously getting following kind of Note in error log file of MySQL in both platform - Linux and as well as in windows server editions:-
    2017-06-13T03:02:23.631926Z 4 [Note] Access denied for user 'root'@'localhost' (using password: NO)
and In some cases it is as follow:-
    2017-06-10T08:24:43.953832-06:00 357 [Note] Access denied for user ''@'localhost' (using password: NO)


We have checked there is no PHP script which is trying to connect with user 'root' .

Please help in solving this.
0

MySQL Server

46K

Solutions

60

Articles & Videos

22K

Contributors

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.