MySQL Server

47K

Solutions

23K

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

how to bring common database to object structured JSON.
Hi. I have a database query that will result a list out of tokens for translation.

application.title = "Korpuskonfigurator"
application.dialogs.username = "Username"
application.dialogs.errors.missingfields = "Bitte alle Felder ausfüllen."
anschlagsart = "Anschlagsart"

And so forth. I have to bring this is an object structured JSON file for an external translation engine.
It have to look like s the following JSON sample. The token is splits by its points the structure have to be created.
I tried now a long time, but I complete fail. I hope anybody can give me a hint.

{
  "application": {
    "title": "Korpuskonfigurator",
    "cart": "Projektverwaltung",
    "nyi": "Noch nicht verfügbar!",
    "dialogs": {
      "username": "Username",
      "id": "ID",
      "name": "Korpusname",
      "errors": {
        "missingFields": "Bitte alle Felder ausfüllen.",
        "specialCharacters": "Keine Sonderzeichen erlaubt!"
      }
    },
    "inspector": {
      "stowageHeight": "Stauhöhe",
      "newValue": "Neuer Wert",
      "firstDrilling": "Erste Bohrung",
      "original": "Original",
      "openOPC": "Ändern",
      "positions": "Positionen",
      "finalPosition": "Final",
      "corrPosition": "Korrekturwert",
      "origPosition": "Originalwert",
      "suggestedPosition": "Vorschlagswert",
      "delta": "Delta"
    },
    "helpmenu": {
      "minz": "Min. Z",
      "maxz": "Max. Z",
      "fov": 

Open in new window

0
Having issues with resume upload parsing page:

http://ablcareers-dev.cloudaccess.host/search-abl-jobs/resume/013947 as an example

When a user clicks to upload their resume, and selects CONFIRM INFO, the page refreshes after a couple of seconds and it appears as if no data has been processed.

Code is below, simple file upload and script. Working with Joomla.

<form class="uk-form"  name="frmMain" method="post" id="frmMain" enctype="multipart/form-data">
	<input type="hidden" name="jobId" value="<?= $this->jobID ?>" />
	<input type="hidden" name="email" value="<?= $this->email ?>" />
	<input type="hidden" name="action" value="resume" />


           <input class="form-control  uk-form-large uk-width-7-10" id="filResume1" type="file" name="filResume1" /> <button class="uk-button-primary submit uk-button" >Confirm Info</button>
           <label class="error" for="filResume1"></label>
           <button class="noresume uk-button uk-button-primary" >I  don't have a resume</button>
		   <p style="font-size:12px">No Resume? No Problem you can still apply manually</p>

	
	
		<p id="spProcessing"></p>

	
</form>

<script>
jQuery('.submit').click(function() {
	jQuery('#spProcessing').text('Processing resume ............... ');
	jQuery('#frmMain').submit();
});
jQuery('.noresume').click(function() {
	jQuery('#frmMain').submit();


});
</script>

Open in new window


There are no errors in the console, and I cannot figure out what may be the cause of the issue.

Would the PHP / MySQL version possibly affect tthe functionality of this?

Any insight would be helpful,

Thank you!
0
We are trying to create a search function inside a website to access and search a MySQL Database. The General Search options would be to search the whole database for a specific phrase and combine with a date range. Help is needed to build a PHP script to link to our database and offer a web-based form to allow users to search as detailed above. I have no experience of PHP but have some HTML knowledge.
0
We need to back our 240 GB data .  Here we have not tried any backup procedure  till time.
Tried replication but it does not gets success.

Tool used phpMyAdmin and workbench.
 
Lets us know the best way take backup process.
0
Dear experts.
i have a MYSQL server 5.6.41 running on windows server 2012.
im a the point of migrating it to another windows system with the new MYSQL 8.
i managed to export all the databases which is not an issue via workbench.
but how to i export all the usernames and privalages? its going to be an issue to recreate them all manually.
can anyone help please?
0
Hello Friends, PLEASE I need your help. My php website just went berserk and I do not know why and what happened. On the home Page I get this message
- Access denied for user ''@'localhost' (using password: NO). -

And since then I cannot log into the admin side of the website and most of the website contents are not displaying again. The site is written in php and is a b2b marketplace.

Please how do I rectify this.

Thanks for your help in advance

Mazicja
0
I have 50 csv files and they all share same structure like same column names and number of columns. I would like to import the csv files into mysql database in separate tables (1 table per file). It would take me a lot of time if i do it manually one by one and would like to know if there is an easy to do this all at one time. I am new to mysql I only know some basic so any help would be really appreciated.
0
HI,
Joomla fronted show this error but backed is working fine. i don't understand  what is the issue.

1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2018-08-21 10:4' at line 1

Open in new window


Please help me.
Thanx
0
I have MySQL 5.6 community server on Windows. How to configure so that Workbench and .Net Web App client  can use SSL to connect to the MySQL server?
0
Dear Experts,

I am currently experiencing data loss issues on magento table (name  catalog_product_entity_group_price) .
After the insert and check with the count command, the record is still sufficient. But after a while, especially when running price index script, I check the that table again, some record rows are disappeared.

Please help me, why Mysql DB Table Rows Disappearing, other reason can cause row loss in mysql ?

Thanks!
0
I have a wordpress website with thousands of custom posts.  I'd like to be able to edit them and/or bulk create new custom posts by inputting information into something like a spreadsheet broken down by field.

I've tried the WP-CSV plugin and it did work for bulk editing and post creation until the site got too big (memory issues I believe).  

Is there a plugin that might work for this application, or is this best as a mysql operation (I don't know mysql).

Thanks!!
0
MySQL installation issue..I'm trying to install MYSQL via MSI installation for windows. The configuration doesn't start the server and ends withe the following error

Waiting 3 seconds before the next connection attempt...
  Retry 3: Attempting to connect to Mysql@localhost:3390 with user root with no password...
MySQL error 0: Reading from the stream has failed.

However i couldn't able to skip without a password in the wizard.

Please let me know how to fix this problem
0
How I can I update a value I got from an Select query?

Sample: Update mytable1 Set my mytable1.value = (Select value from mytable2 where mytable2.id=1) where mytable1.id=1
And do not want to select. put in to a variable and write back to the db.

I use a MySQL Database on Linux.
0
I have a MySQL database. Can anyone help me on how to auto increment a column in which is an integer? I am totally new to databases

An increment is a 7 digit number and it has to custom auto increment

CREATE TABLE `march13airtelvd` (
  `id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `country_id` int(50) NOT NULL,
  `operator_id` int(50) NOT NULL,
  `os` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `testType` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `placeType` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `performanceType` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `technologie` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `dateTest` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `testValue` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `lat` double NOT NULL,
  `lng` double NOT NULL,
  `nameCity` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `id4gmark` int(10) NOT NULL , (This column has to be in auto increment which starts from "1100000")
  `source` varchar(50) COLLATE utf8_unicode_ci NOT NULL

)
0
Guys how can I add username already exist on this error handler?... I already have for email but don't know how to add username
here is my code
<?php
require_once 'db.php';

if($_POST)
{
    $username      = ($_POST['username']);
    $email     = ($_POST['email']);
    $password  = ($_POST['password']);
    $joining_date   = date('Y-m-d H:i:s');
    $password   = password_hash( $password, PASSWORD_BCRYPT, array('cost' => 11));
	
///Start of second try    
    try
    {
        $stmt = $connection->prepare("SELECT * FROM users WHERE email=:email");
        $stmt->execute(array(":email"=>$email));
        $count = $stmt->rowCount();
        
        if($count==0){
            $stmt = $connection->prepare("INSERT INTO users(username,email,password,joining_date) VALUES(:uname, :email, :pass, :jdate)");
            $stmt->bindParam(":uname",$username);
            $stmt->bindParam(":email",$email);
            $stmt->bindParam(":pass",$password);
            $stmt->bindParam(":jdate",$joining_date);

            if($stmt->execute())
            {
                echo "registered";
            }
            else
            {
                echo "Query could not execute !";
            }

        }
        else{

            echo "1"; //  not available
        }

    }
	///End of first try
    catch(PDOException $e){
        echo $e->getMessage();
    }
}
?>

Open in new window

0
I have a linux site. I create a cvs file no broblem

Thing is i write to /var/lib/mysql-files

I need acces to those csv files via  browser

folder is /var/www/html but I cant write to it (The MySQL server is running with the --secure-file-priv option so it cannot execute this statement)

What can I do and how?

Grant access so I can write to /var/www/html  (Dont know how)

Or Browser access to  /var/lib/mysql-files.  I tried with a symbolic link. No luck

Any ideas?
0
Hello! I'm trying to make my first web application of a hotel(this is an education project not a payed one) and I have a lot of issues...The most important one is that if a user at the registration process selects that he wants to reserve 4 rooms he needs to make the checkin process 4 times, once for each room. I have succesfully managed to register the user and login, but the problem is with showing the check-in form for a number of times... I managed to show it once, but the second time it doesn't work, it shows me the details for the same room, not for a different one, or it makes an infinite loop...what can I do? Here it's the PHP code:
<?php
	ob_start();
	 $success = false;
	// Errors reporting, used if needed
	error_reporting(E_ALL);
	ini_set('display_errors', 'on');

	// General configuration like base, used if needed
	include_once ('include/config.inc.php');

	// Mail functions
	include_once ('include/mail.functions.php');



	// DBConn
	include_once ('class/DB/DBConn.includeall.php');
	$db = new DBConn(NULL);

	// Includere clasa login
	require_once ('class/class_login.php');

	// Set up current language
	$lang = "ro";
	$_SESSION[PRE.'lang'] = $lang;
	$row='';
	$access = 0;
	$user = (isset($_POST['nume']) && !empty($_POST['nume'])) ? $_POST['nume'] : "" ;
	$email = (isset($_POST['email']) && !empty($_POST['email'])) ? $_POST['email'] : "" ;
	$telefon = (isset($_POST['telefon']) && !empty($_POST['telefon'])) ? $_POST['telefon'] : "" ;
	$cnp = 

Open in new window

0
What is wrong with my mysql query?

select * into OUTFILE '/home/galaplas/public_html/seminario.com.mx/descargas_parquev/TD2489DAA2C294F9092B9207298A46527717201840949PMx.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY'\n' from (select * from TD2489DAA2C294F9092B9207298A46527717201840949PM order by estado,armadora,vehiculo,modelo) as temp

Table exists user password database connected ok executed in phpmyadmin

I need to write the csv  file in the /descargas_parquev/ folder
0
I am trying to select a value from dropdown list and insert into mysql database, i am new to PHP and i know my code is not pretty but i want to learn, please steer me in the right direction. Thank You.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>

<form method="post" action="">
 
 <label >Please Select Username</label>
 
 <select name="checkin">
<?php
 require('db.php'); 

$sql = mysqli_query($con, "SELECT * FROM users LEFT JOIN check_in_out on users.id = check_in_out.check_id WHERE check_in_out.check_id IS NULL");
while ($row = $sql->fetch_assoc()){
echo "<option value=\"checkin\">" . $row['id'] . "</option>";
}

 ?>

</select>

 <button type="submit" name="submit" >Submit</button>
 


<?php
 require('db.php'); 
if(isset($_POST["submit"]))
{
 
$check_id ='check_id';
$check_in_date = date("Y-m-d H:i:s");
$sql =  "INSERT INTO check_in_out (check_id,check_in_date) VALUES ('$check_id','$check_in_date')"; 
$result = mysqli_query($con,$sql);

    echo "You are checked in";
}

 ?>
  </form> 
</body>
</html>

Open in new window

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
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'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
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
I am trying to come up with a query that looks at table_1, and compares it to multiple rows in table_2 to see which row value that matches up inside table_1.

To provide further detail, I have a table of students that has a distance from school column.  The distance to school column is most likely a decimal value between 0 and 50 miles.

In Table 2, I have 5 potential rows that the distance of school would match up with. This table contains a minimum distance column and a maximum column value.

Row 1 has a minimum value of 0 and a maximum value of 10
Row 2 has a minimum value of 10 and a maximum value of 20
Row 3 has a minimum value of 20 and a maximum value of 30
Row 4 has a minimum value of 30 and a maximum value of 40
Row 5 has a minimum value of 40 and a maximum value of 50

The ultimate goal would be to get the price from Table 2 that correlates to the correct distance to school value from Table 1. Each range in Table 2 has a corresponding price.

I'm sure it's a matter of using a case statement, but I'm not sure how I'd go about writing it.

Any direction would be greatly appreciated.  Thank you!
0
Hello guys I know it is so simple with you guys.
How can I disable button if userID is not equal to "1"

<button id="edit" class="edit" value="Edit"/>

How can I disable that button if userID is not equal to 1


Thank You in advance
0

MySQL Server

47K

Solutions

23K

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.