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

while using php code for each month and date .....why cant we use "if condition" or any other looping condition
0
I am trying to get fields that have partial matching addresses to match via different suffixes for addresses.. for example:

10 hideman Street would qualify as a match of 10 hidman St.

These are the suffixes I am working with so far:

s/street/st
road/rd
drive/dr
boulevard/blvd
avenue/ave

This is my query, but I need to know how to edit it to match the address fields with the above conditions:

SELECT
`group`.`Group ID`,
`group`.`Additional Address Line 1`,
smart.subs_acct_num,
smart.Address,
smart.mac_address
FROM
`group` ,
smart
WHERE
`group`.`Additional Address Line 1` = smart.Address
0
I would like to run a query using SSH and export those results to a csv file.

I can connect to the DB using SSH and run the query, but how do I get it to output the results to a file vs screen output?

Basically

Connect to MySql vis SSH
Query select first,phone from tablename where active='y'
output to leads.csv

Thanks in advance
0
Hi All,

I am trying to setup a WordPress site for a company that does not have internet access.  It takes quite a while to load as each of the external HTTP requests have to time out.

Is there a way to disable / block the HTTP requests?

I tried adding this to my wp-config.php, but it doesn't appear to have done anything.

define('WP_HTTP_BLOCK_EXTERNAL', true);

Open in new window



Any suggestions?
0
Good Afternoon,
I have a MYSQL table where I need a query to identify any duplicate rows the entire row so all column's need to be the same.  The best I have come up with is the below but its not functioning correctly.

SELECT Customer, Department_user, Plex, Colour, Pages, Envelope, Date, Postal, EnvelopeType, SystemVersion, DateTime, COUNT(EnvelopeType) AS Occurance_Count
FROM        Epod
GROUP BY Customer, Department_user, Plex, Colour, Pages, Envelope, Date, Postal, EnvelopeType, SystemVersion, DateTime
HAVING     (COUNT(EnvelopeType) > 1)

Thanks

John H
0
Hi,
When I try to restore a db backup (40Mb zipped), It takes around 5 mins to upload and  then around 2 mins later I got this error

Internal Server Error 500 The cPanel Server operation timed out at cpsrvd.pl line 541.

I changed

max_execution_time=9000
cPanel PHP max execution time=9000

but it did not help. Any ideas?
Thank you.
0
Hi,

I am about to start building a module to manage client services. Based on what the client purchased, those steps can vary. For example,

Product A
- get code from client
- send code to vendor
- get serial number from vendor
- send serial number to client

Product B
- get a list of names from client
- send names to engraver
- get product back from engraver
- send product to client

There could be as many as 15-20 steps in the process depending upon the product purchased.

What I am trying to figure out is the best way to manage the process using mysql and PHP. So, far what I am thinking is creating a table (customer_service_process) with all the many possible steps for all products. Then for each product I could have a field for the steps necessary for that specific product. Then I could pull the 'customer_service_process' record for the client and see which steps were necessary for their product and step through the process. This would work, but seems a little inefficient site I could have many unnecessary fields for each client. Also not a great idea if a new product is added and a new step in the process is required.

Any experts with experience building something like this? Any suggestions on how best to manage this?

Thanks in advance for your time in giving me some input on this project.
0
creating View  in MYSQL SERVER getting to much  slow down for  more then  twenty thousand records.
The view have been created in mysql. But when i click on the browse then it getting  slow down . main issue is that how can i handle large records in mysql views. Aactually i am converting Ms Access Database into mysql . there is lot of queries in Aaccess DB that i have to need use as view in mysql . but for large getting queries when i use in mysql for view then it gett very slow .


here is the example of query that is used for creating view in mysql server.it is fetching twenty thousand records.

SELECT FormulaInfo.FormulaInfoID, (Sum(formuladetail.Qty*fragrance.cost*unittable.unitconverter/`unittable_1`.unitconverter)/totalqty) AS UnitCost,
 Format(Sum(formuladetail.Qty*fragrance.previouscost*unittable.unitconverter/`unittable_1`.unitconverter)/totalqty
, 'Currency') & ' / ' & `unittable_1`.unitcode AS UnitPCost
FROM (UnitTable INNER JOIN Fragrance ON UnitTable.UnitID = Fragrance.Unit) INNER JOIN
(((FormulaInfo INNER JOIN FormulaDetail ON (FormulaInfo.FormulaID = FormulaDetail.FormulaID) AND (FormulaInfo.Revision = FormulaDetail.Revision)) INNER JOIN UnitTable AS UnitTable_1 ON FormulaInfo.Unit = UnitTable_1.UnitID) INNER JOIN Qry_FormulaList_TotalQty ON FormulaInfo.FormulaInfoID = Qry_FormulaList_TotalQty.FormulaInfoID) ON Fragrance.FragranceID = FormulaDetail.FragranceID
GROUP BY FormulaInfo.FormulaInfoID, Qry_FormulaList_TotalQty.TotalQty, …
0
Hi Experts,

we need your help in analyzing one of our reporting server issue. Actually,Few  of our SQL reports are connecting to MYSQL server via a MYSQL driver and fetch details from it. But whenever we are executing this report, SSRS is getting crashed and generating few logs in both Event viewer and Reporting services.I have enclosed them,so please check and advise on this

FYI...On Different server with the same configuration , when we are executing this report,it is executing successfully.

Regards,
Narendar Poosa.
Eventviewer_Error.PNG
ReportServerService__05_18_2017_13_2.log
0
I have Database in MS Access of my application and Now i want to convert into MySQL server database . Actually problem is that i have successfully import all tables by MySQL ODBC Driver. But there is some queries in access database and i am trying to convert into MySQL as views. when i am creating views from access databases query after change the query syntax as sql query . in some case the it will take too much time.
My main Question is that what is the best way to handle these access database queries in MySQL. is as Views or Store procedures or as Functions in MySQL server .please quid me and give me the right suggestion .

Thanks in advance
2017-05-12_2310.png
0
Hi all,

I wanted to backup few tables from RDS to my remote mysql server on daily basis.
Using Mysqldump on cron would work but issue is that its too huge and updating whole records again is not feasible .
Wanted script or some method to update or add only newly added or updated records on my remote DB Server so that server don't gets loaded or consumes too much time.

OS: ubuntu
db : mysql
0
I want to create a procedure which has one input parameter for table name and two output parameters for 'status message' and 'return code'.  And input table name is SCORE table.
For the SCORE table, the parent tables are STUDENT and GRADE_EVENT tables. And I need to add a column (PARANT_COLUMN) to the parent tables, the datatype is INT for the column.
0
Hello

I have seen many complex articles about how best to represent a hierarchy in a database. For example I saw this post which is beyond my level of myself

http://stackoverflow.com/questions/4048151/what-are-the-options-for-storing-hierarchical-data-in-a-relational-database

I also saw this article where you have a very simple database design for the hierarchy and then filter using php. http://stackoverflow.com/questions/41291683/obtaining-mysql-to-get-hierarchical-data-structure?rq=1

The database deign in this last link was how I planned to store the data:

e.g. call table Heirarchy
Fields
id
descrition
parentid (FK which links to back to another row in the same table)

In general when I have asked questions I am advised the database was designed to handle the data you want and its retrieval, not the language you are looking for

As I said the first link in the question was too in depth for my needs. Being as this must be such a common requirement I imagined there must be a database design that lets you have an unlimited number of rows in your hierarchy and then do queries like

1) get all parents in the hierarchy (e.g. select * from hierarchy where parentId is null)
2) get second row in hierarchy (e.g. select * from hierarchy as a inner join heirarchy as b on a.parent id = b.id where b.parentID is null

It then started to get more complex where I was thinking how to get third level items in the hierarchy.


e.g. select a.*  from hierarchy as a…
0
Hi, I want prevent user to connect at the same times in two computer.Please Help

I try this but it not working


session_start();

 if(!(isset($_SESSION['login']) && $_SESSION['login'] != ''))
 {
 session_destroy();
       $redirect_to = isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '/wordpress';
        $location = str_replace('&', '&', wp_logout_url($redirect_to));;
        header("Location: $location");
}

Open in new window

0
Greetings,

What is the best method to convert an existing MySQL 5.5 Database with Latin1 language format to UTF8MB?
0
I am currently using 2 querys, one to get column names and one to get data from a mysql database.
How can I make this into on query?

$sql = "SHOW COLUMNS FROM $table_name";

$sql = "SELECT * FROM $table_name";
0
I have created a google map. A user clicks on his location and pins the marker at that location, now when he clicks on the marker a info-window pops up with a form asking his details.
I have created a table in mysql with all the columns asked in the form.
I have also created the python script in PyCharm CE that is required to process the form details and store in the mysql table I created. However this does not happen.
When I click on the submit button in the html web form, instead of storing the data in the mysql database table I created, It displays the entire python code that I had created, and it is not storing anything in the mysql database table.
Please help me at the earliest.....I have been stuck on this for many days
Help would really be appreciated.
I am pasting all the codes below for reference, if possible please do correct them and let me know about the mistakes as well or anything else that I'm missing.
Thanks in advance.

HTML/JavaScript Code:
<!DOCTYPE html>
<html>
         <head>
               <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
          <meta charset="utf-8" />
            <title>MAPS</title>

            <style>
                  #map {
                        width: 100%;
                        height: 100%;
                  }

                  html, body {
                      height: 100%;
                      margin: 0;
                      padding: 0;
                  }

                  #description {
                      font-family: Calibri;
                      font-size: 15px;
                      font-weight: 300;
                  }

                  #infowindow-content .title {
                      display: none;
                  }

                  
                  #map …
0
Hi Guys,

In my application I use a MySQL-connection. If this connection is not used for a period of time it times out. Is there any way to detect this, because the connection state remains open. Just sending a query to test takes a long time before it times out so I was hoping for a different approach.

Thanks!
0
Hi everyone,
A few days ago i opened phpmyadmin and turned out to give this error
"#2003 - The server is not responding "
-phpmyadmin version 2.9.2
-PHP versin 5.2.1
-APACHE version 2.2.4
Please help me out.
0
Table 1 :  SLOTS
Columns : StdId, StudentName , Slot1, Slot2

Value examples for
Slot1 :  SUN-01, SUN-02, THU-04 etc
Slot1 :  FRI-01, WED-02, THU-03 etc


Table 2 : TIMINGS

Columns :  ClassId, ClassDay, ClassTiming, ClassLocation
FRI-01, FRIDAY, 04:30 - 05:30

Value examples for
ClassId :  FRI-01, SUN-02, WED-04 etc
ClassDay :  FRIDAY, WEDNESDAY, SUNDAY etc
ClassTiming : 4:30 - 5:30, 09:00 - 10:00 etc,

Need to display records from the two tables in this manner
StdId , StdName, Details of Slot 1 (i.e FRIDAY 09:00 - 10:00),  Details of Slot 2 (i.e SUNDAY 09:00 - 10:00)
example :
1 STUDENT NAME , FRIDAY 4:30 - 5:30, SUNDAY 10:00 - 09:00
2 STUDENT NAME2 , MONDAY 4:30 - 5:30, TUESDAY 4:30 - 5:30

So, the  Slot1 and  Slot2 from Table 1 should pick up its related records from Table 2 and display them

Using PHP, mySQL, PDO . ALL fields are VarChar

Please Guide
0
Hi there,
I have a VM hosted in Azure which runs a Bitnami-Dreamfactory VM. During upgrading the DreamFactory libraries accesing the mySQL stopped working.
I am now trying to extract the mySQL database so I can put in a freshly installed VM.
Problem is we can not access the mySQL database. Resetting root password also doesnt work even on safe mode.

If you are familiar with Bitnami-DreamFactory VM and think you can help me extract the mySQL database, please help.
Thank you,
Andres
0
Looking for someone to assist with gathering cpu, ram, hd stats for our Redhat and MySql install. I heard we can pay for this service now. Someone please let me know.
0
I try to replicate my email server db to another server for backup.  When there is an update on the master db, sometimes it will miss data inserting into one of the tables on the slave server. It will add the row but the data inside are all "Null". Then, it will try to add that row again and it will generate the duplicate primary key error which causes the replication to stop. On the internet, a lot of people say to skip the error, but I don't think it is the right way to do it because it will create the inconsistency on the slave db.
0
I need to upgrade an old MySQL Database.  Working on windows 10.  MySQL 5.7.  Older version of MySQL I believe is 1.4.  

I have the files.  They are .MYD, .FRM, and .MVI.

I created a database in MySQL (let's say MyDbase).  I looked for the database to try to copy files in that folder and haven't found it.

Any ideas?
0
Hi Team,

  I have mysql running in a docker container in my centos 6.6. server.  With my docker container  called "mysql",  I create this useful script that copies  my "PATCH_RECORD" table in my niis database daily and it works fine.

docker exec mysql mysql -u root -pmypassword niis -e  "CREATE TABLE patching_`date  +%d_%h_%Y` SELECT * FROM PATCH_RECORD; "

Open in new window


I then have a cron job that runs the script daily so I have daily backups of my PATCH_RECORD table.

Now I need to drop the backed up tables older than 5 days by running another cron job so i don't keep tables more than 5 days old.  I am trying to get the exact syntax for this but can't seem to catch it.  Something like this:

docker exec mysql mysql -u root -pmypassword niis -e  "DROP TABLE patching_`date +%d_%h_%Y -5d`; 

Open in new window


The bash interpreter is interpreting -5d as text so it is resulting in a syntax error.  I tried various combinations of -v, or -d   or putting "-5d" with no luck.

Any help with syntax will be appreciated.
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.