MySQL Server

47K

Solutions

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

hi,

I read this :

https://mysqlhighavailability.com/mysql-cluster-manager-1-1-2-creating-a-cluster-is-now-trivial/

what is the cluster manager for MySQL supposed to do on the installation of MySQL Cluster?

I knew that we can use Auto-installer to install the whole MySQL cluster on diff nodes, so what about that manager suppose to be?
0
Cloud Class® Course: SQL Server Core 2016
LVL 12
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

MySql download

I am planing to downoad Mysql, however I see there are separate files to download. Mysql Installer,Connector,Workbench,Notifier.etc...
My objectif is to download Mysql and be able to connect  to it through its own GUI, also be able to  use a program language to connect to it programatically

any help ?

Thank you
0
I have a MySQL database. When I fetch a specific record with "SELECT * from projects where pid = 40", I get the attached. Note the column bfh1 = "Y". I have a php program that reads the contents of the record & stores the results into a series of $_SESSION variables. That program, with echos added to see what is happening, is here:
<?php
error_reporting(E_ALL);
// load_proj.php
$pid = intval($_GET['ppid']);
$nosumm = intval($_GET['nosumm']);
$ddocs = $_GET['disp_docs'];
//echo "ddocs in load_projn = " . $ddocs . "<br>";
session_start();
include "db_connect_nb.php";
$qry = "SELECT * from projects where pid = " . $pid;
echo "proj qry= " . $qry. "<br>";
$res = mysqli_query($link, $qry);
$p = mysqli_fetch_array($res,MYSQLI_ASSOC);
echo "p[bfh1] = " . $p['bfh1'] . "<br>";
// set all the session stuff
$_SESSION['project'] = $pid . "~" . $p['project_name']; 
$_SESSION['cltype'] = $p['cltype'];
$_SESSION['class'] = $p['cltype'];
$_SESSION['wttp'] = $p['wttp'];
$_SESSION['liq_type'] = $p['liq_type'];
$_SESSION['liq_source'] = $p['liq_source'];
$_SESSION['pgrp'] = $p['pgrp'];
$_SESSION['flow'] = $p['flow'];
$_SESSION['flevel'] = $p['flevel'];
$_SESSION['access'] = $p['access'];
$_SESSION['model'] = $p['model'];
$_SESSION['net_price'] = $p['net_price'];
$_SESSION['total_price'] = $p['trade_price'];
$_SESSION['mtype'] = $p['Material'];
$_SESSION['afs'] = $p['AFS'];
$_SESSION['wof'] = $p['wof'];
$_SESSION['atra'] = $p['atra'];
$_SESSION['abf'] = $p['ABF'];
$_SESSION['spapp'] = 

Open in new window

0
Hi,

im curious if there is a way to do the following in PHP but within a stored procedure with SQL on the fly

$managers = array(
	0 => array(
		"id"	=> 1,
		"name"  => "manager",
		"email"	=> "email"
	)
	...
)

foreach($managers AS $d){
	//send mail
	mail(...);
	
	//Insert into messages table
	INSERT INTO...

}

Open in new window


Essentially, i would want to SELECT the manager from a table and then immediately insert it a message into the massage table

for example:

1. select manager 1
2. insert message into message table for manager 1
3. repeat for manager 2
,...so on

I would handle sending the email using php

I KNOW i can do this in a few steps such as
1. Select all the managers and organize them into an array to loop over
2. loop over the managers and create an array of emails as well as sql statements i can create a transaction with and submit the inserts all at once
3. complete loop
4. send the transaction to sql
5. send the email

but i am curious if i can do it one for one within a stored procedure

Thanks in advance
0
can I connect mysql workbench to two normal desktop or laptop computer
0
Dear experts,
I have table named "followers"
I have information about users on that table. User's id, lattitude and longtitude and the date when the information is recorded on my table.
but it repetitives, same userid has more than one row. I need to select the last inserted userid with latitude and longtitude information.

I want to select the last recoreded userid with the lat, lng columns

My columns are:

id ( auto_increment )
userid
lat
lng
date (datetime)

thank you
0
I'm new to mysql and need some help. I have populated a multi-select drop down with my first query. The dropdown populated correctly and I want to use the value or values from the dropdown to get results from a second query. I will try to explain some more.

I have a multi select dropdown named students that is populated with Names and values that are numbers. I want to select one, two or all and use those values in a second query. The dropdown will have values like 390, 234, 5421, 461. If you look at the query below you will see the student_id = 461 that value is what I want to get from the dropdown. This query works if I place in the student_id.

SELECT *, student_id, SUM(handled) FROM stats WHERE student_id = 461

From there I
echo "Handled: " . $row["SUM(handled)"]. "";
and that works just fine.

Thanks for any help.
0
I'm looking for MySQL query that will replace values in a certain column matching certain value
so in this example I'd like to replace only all ABC  values under only Column1 with say 123 and leave XYZ unchanged, CBD
ID | Column1| Column2
1 | ABC           | blah
2 | ABC           | blah
3 | XYZ            | blah
4 | CBD          | blah

Thanks!
0
I have a MySQL database table called app_codes. It has 8 rows, 2 cols. It is shown in the attached file.

I have the following php code to access the table:
$qryac = "SELECT * from app_codes order by code";
	$resac = mysqli_query($link, $qryac);
	$na = mysqli_num_rows($resac);

Open in new window


Then I have his HTML/php to populate an HTML select element:
<div class="col-sm-5 col-xs-5" style="padding-top:2px; padding-bottom:2px;"><select name="appl_type">
		<option value=""></option>
		<? for ($i = 0; $i < $na; $i++) { 
			$ac = mysqli_fetch_array($resac,MYSQLI_ASSOC); ?>
		<option value="<? print $ac['descr']; ?>"><? print $ac['descr']; ?></option>
		<? } ?>
		</select></div>

Open in new window

All this works exactly as expected. The select has the descr values from the table.

Now, I need to know the code column connected with the selected description.

How can I do that in php or Javascript?  I can build Javascript arrays of both table columns.

Thanks
Appl_type_table.JPG
0
I am having to convert a MS SQL Project to MySQL.
In MS SQL I have a stored Procedure with a complicated Query that uses a Temporary table multiple times to filter out Sub Query.
The Temporary table is filled at the Beginning of the Procedure with a variety of values based on Supplied Parameters.

The Question is how can I do this in MySQL which refuses to allow using a Temporary table twice in the same Query!

The Temporary table simply holds integers with are then used to filter in the pattern of
select * from table A where A.Field in (select Val from TempTable)
Inner Join (Select * from Table B where B.Field in (select Val from TempTable)) as SubTable where SubTable.Field = A.Field
0
Cloud Class® Course: MCSA MCSE Windows Server 2012
LVL 12
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

I need an app based (session independent) counter that gives me the order of the queries that are done to server.
Does PDO (or MySQL) has an internal counter for that? If it does not have how a can I get the order of the queries without writing to db or using the file system.

What I do right now is
1. construct my PDO object  :
$dbpdo = new PDO("mysql:host=$db_host;dbname=$db_name", $db_username, $db_password, array(PDO::ATTR_PERSISTENT => true));
$dbpdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbpdo->setAttribute(PDO::ATTR_TIMEOUT, 30);
$dbpdo->query("SET NAMES utf8");  
      
2. Do the query:
$q = $dbpdo->prepare($sql);
$q-> execute($arr);

I need the order number of the query (app based)

Thank you
0
While trying to install Zabbix on a new install of CentOS 7 I keep running into the same errors surrounding installing MySQL.

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirror.ndchost.com
 * extras: centos.mirror.ndchost.com
 * updates: sjc.edge.kernel.org
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.56-2.el7 will be obsoleted
--> Processing Dependency: mariadb-server for package: akonadi-mysql-1.9.2-4.el7.x86_64
---> Package mysql-community-server.x86_64 0:5.6.40-2.el7 will be obsoleting
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.40-2.el7 for package: mysql-community-server-5.6.40-2.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.40-2.el7.x86_64
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.56-2.el7 will be obsoleted
---> Package mariadb-server.x86_64 1:5.5.56-2.el7 will be obsoleted
--> Processing Dependency: mariadb-server for package: akonadi-mysql-1.9.2-4.el7.x86_64
---> Package mysql-community-client.x86_64 0:5.6.40-2.el7 will be obsoleting
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.40-2.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.6.40-2.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be obsoleted
---> …
0
hi,

I am going to do some functional test when comparing MySQL Cluster and MariaDB, I know MariaDB by some studies, is faster when compression is on. So any kind of test make mariaDB stand ahead of MySQL cluster and any test can be make to show MySQL cluster is faster than MariaDB?

1) I will do simple select statement and failover.
2) will simple select statement with compression is on and during the select statement is running, I try failover back and forward.
any thing else can show difference of 2 ?
0
I have a mysql table

select  * from parquevw  limit 100

Works fine

But I need it to be output to a tab separated values file like:

select  * from parquevw  limit 100  into 'test.txt'

I get this error:

Access denied for user 'adminp'@'%' (using password: YES)

Where will the test.txt file be saved?

What permissions do I need? Where do I set them?

I have a cpanel linux site

Thx
0
need connect different database as such Mysql and Oracle to the sharepoint by web service
but the issue is oracle cannot connect
i need online help
0
This query will select all rows from all tables based on the criteria given in the where clause. I need to figure out how to execute the query for multiple conditions like 10 at once without having to do it separately for each condition.

Thanks


SELECT
     GROUP_CONCAT(qry SEPARATOR ' UNION ')
     INTO @sql
 FROM
 (
     SELECT CONCAT('SELECT * FROM `',table_name,'` where customer like ''','John%','''') qry
     FROM
     (
         SELECT table_name
             FROM INFORMATION_SCHEMA.COLUMNS
             WHERE  table_schema = 'yourdatabasenamehere'
              AND column_name LIKE 'customer'
         
     ) A
 ) B;
PREPARE s FROM @sql; EXECUTE s; DEALLOCATE PREPARE s;
0
How can I create a mysql database with adminer?

I am using solidcp as conrol panel. I created a databse from there (name,password and user)

But I go into admner and it says the database (name) doesn't exist and it doesnt appear in the available databases

In adminer I have tried localhost and mysql.server to no avail

Any ideas?

Thx
0
Hello there, wondering if anyone could point me in the right direction? I have the query below which outputs pivot style table in php. I now need to somehow break it down to show quarterly data too but have hit a wall! ie 2015_Q1, 2015_Q2 etc etc etc

If not possible within this query could it be done in a seperate query at all independent of this one?

SELECT
  Sum(CASE WHEN Year(i.signedupdate) = 2015 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) '2015',
  Sum(CASE WHEN Year(i.signedupdate) = 2016 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) '2016',
  (Sum(CASE WHEN Year(i.signedupdate) = 2016 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) - Sum(CASE
    WHEN Year(i.signedupdate) = 2015 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END)) / Sum(CASE
    WHEN Year(i.signedupdate) = 2015 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) * 100 AS '15-16',
  Sum(CASE WHEN Year(i.signedupdate) = 2017 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) '2017',
  (Sum(CASE WHEN Year(i.signedupdate) = 2017 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) - Sum(CASE
    WHEN Year(i.signedupdate) = 2016 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END)) / Sum(CASE
    WHEN Year(i.signedupdate) = 2016 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) * 100 AS '16-17',
  Sum(CASE WHEN Year(i.signedupdate) = 2018 THEN i.comms + i.broker_fee + i.legal_fees ELSE 0 END) '2018',
  (Sum(CASE WHEN Year(i.signedupdate) = 2018 THEN

Open in new window

0
hi,

I am checking the MySQL cluster evaluation guide and i has one terms :

"As MySQL Cluster stores tables in data nodes, rather than in the MySQL Server, there are multiple
interfaces available to access the database."

I think data nodes is MySQL server and MySQL cluster just consist of many MySQL servers, it seems not correct if, according to the statement above.. ?
0
Cloud Class® Course: Microsoft Azure 2017
LVL 12
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Hi,

Right now want to setup MySQL cluster and MariaDB Galeria Cluster to test the product on how well it function, so in order to prepare for it.

1. How many redhat linux nodes on testing each of this?
2. Anything else needed?
3. no shared storage is needed as actually the testing should not have shared storage and we should try horizontal scale out.
4. anything we should test on  cluster ?
5. can we use only node with 1 x network card to install ProxySQL and test it?
1
Hi,

I've a table on AWS Redshift with couple of columns in JSON format.
So i'm using JSON_EXTRACT_PATH_TEXT Function to query the data in the JSON format cloumn.

For example ,

SELECT user,json_extract_path_text(payload,'code') as payload_code FROM activity_log.lx4_logs
where event_reference LIKE 'My Dashboard%'; .

So the output look like following with two coloumns

User       | Code
user1      | ["13877512003","13877642003","10078402003","13901222003","10118722003"]
user2     |["105700520150300750","106468920140600750","112279220150300750","104693120060101500","122805820150600750"]
user3    |NULL
user4    |["10112472015"]

Is there a possibility to get the output, into rows like below without any quotation, square brackets etc please ?

User       | Code
user1      |13877512003
user1      |13877642003
user1      |10078402003
user1      |13901222003
user1      |10118722003
user2     |105700520150300750
user2  |106468920140600750
user2   |112279220150300750
user2  |104693120060101500
user2  |122805820150600750
user3    |NULL
user4    |10112472015

Thanks
0
Hi,

Right now want to setup MySQL cluster and MariaDB Galeria Cluster to test the product on how well it function, so in order to prepare for it.

1. How many redhat linux nodes on testing each of this?
2. Anything else needed?
3. no shared storage is needed as actually the testing should not have shared storage and we should try horizontal scale out.
4. anything we should test on  cluster ?
5. can we use only node with 1 x network card to install ProxySQL and test it?
0
I have 2 MySQL databases who are identical in every aspect.

But DB1 changes daily with either some records changed or few new added.

I need to take the DB dump daily and then import to DB2 for them to stay identical.

My question is that, how can I dump the DB 1 so the dump should insert only new records to DB2 and for records that are changed, just update them.
0
How to select all rows from all tables when a column equal a given name. I have like 100 tables using union all function would take alot of time. Answers appreciated.
0
Hello

What is the Best way to search multiple tables in a MySQL database for Multiple search Terms?

Some Notes
  1. Currently I have it working Fine in MS SQL but have to change to MySQL
  2. The Search is done by Calling a Stored Procedure/Routine
  3. I am using Dynamic SQL to enable all the Search Filter Options
  4. I am also using Parameters to protect against SQL Injection.
  5. Search Columns are both Varchar and Integer
  6. The Procedure is sent 10 search Terms that need to be searched for.

In MSSQL I can use Named Parameters but these aren’t available in MySQL so I would have to pass 60 Parameters to the Prepared Statement.
This would have the Potential for Errors – Ensuring that each Parameter is in the Correct Order!!

How should I do this?

Following it the MSSQL code.
DECLARE @SQLSelectFields NVARCHAR(MAX)	= ''
DECLARE @SQLString NVARCHAR(MAX) = ''
DECLARE @SQLFilter NVARCHAR(MAX) = ''
DECLARE @SQLTables NVARCHAR(MAX) = ''

-- Tables to Select From
SET @SQLTables = ' dbo.PURCHORD_HDR AS POH ' + ' INNER JOIN dbo.ppp_vw_Company C ON C.AccountID = POH.ACCNO AND C.AccountType = 2 '
				+ ' LEFT OUTER JOIN dbo.CONTACTS CO ON CO.SEQNO = POH.CONTACT_SEQNO '
				+ ' LEFT OUTER JOIN dbo.NARRATIVES N ON N.SEQNO = POH.NARRATIVE_SEQNO '


-- Min Fields for General Searching and use
SET @SQLSelectFields = ' POH.SEQNO, POH.STATUS, POH.ORDERDATE, POH.DUEDATE, POH.REFERENCE, POH.ADDRESS1, 

Open in new window

0

MySQL Server

47K

Solutions

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.