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

Hello,

I am getting following error while starting phpmyadmin.

 MySQL said: Documentation
#2002 - Connection refused — The server is not responding (or the local server's socket is not correctly configured).
mysqli_real_connect(): (HY000/2002): Connection refused
Connection for controluser as defined in your configuration failed.
mysqli_real_connect(): (HY000/2002): Connection refused
0
Hi,
I am developing a small friend contact list for my personal website, wherein I want my friends to update their personal details, like address, city, phone number, email address etc. after login.
There are fields like address, city, phone No., email, which is editable and fields like Names are not editable.
Flow:
login.php-->mainpage.php [where all the fields are getting displayed in column-wise like:
      First Name:
      Last Name :
      Address     :
      City             :
      Phone        :
      Email         :

To edit or update the details, I create a link 'EDIT' Button and link it to a page 'edit_profile.php', where I want my friends to update their latest information. But, the code is not working - I am developing this myself with the help of Internet. May I request you to kindly look into this and correct, it would be a great learning experience for me.

[edit_profile.php] is attached below:
<?php
session_start();
$first_name = $_SESSION['first_name'];
$last_name  = $_SESSION['last_name'];
$Fri_Add1  = $_SESSION['Fri_Add1'];
$Fri_City  = $_SESSION['Fri_City'];
$Fri_Phone1  = $_SESSION['Fri_Phone1'];
$Fri_Email1  = $_SESSION['Fri_Email1'];


if(!isset($_SESSION['restrict'])){
header("Location: ../login.php");
}

include "database/friends.php";
$sqlInfo = mysql_query(" select * from `friends`");

if(isset($_POST['updateMessage'])){

include 'database/friends.php';
$updateMessage = trim($_POST['updateMessage']);
$first_name = …
0
Have a problem getting a stored procedure to work in Adminer
This fails on the first line
Comments / tips very welcome

DECLARE @new_project_id int;
DECLARE @current_snapshot_id int;
DECLARE @new_snapshot_id int;

insert into project select * from project where project_id=@in_project_id
SET @new_project_id = last_insert_id()
for each row in (select * from snapshot where project_id=@in_project_id)
  insert into snapshot values(
       @new_project_id, 
       last_update	 
       snapshot_date 
       snapshot_title	 
       snapshot_note
)
 SET @new_snapshot_id = last_insert_id()
  insert into layer select new_snapshot_id, * from layer where snapshot_id =row.snapshot_id
loop

Open in new window

0
I  have developed free radius management system locally.
but now in my job they asked me to make this system to be selling in a cloud
ie. every user around the world can access our management system from the cloud
he must register a new account in our system and determine his database
that means every user has a different database with same free radius server
my first problem is when a new user had registered to our system his database information will go in SQL.conf file but as we know that free radius does not take his new configuration till restart so I must restart free radius for every new user and interrupt the others work.
the other question is when there are many users with their database for example if I have 100 users and for every user, there is one database that means free radius must connect to 100 different databases  is this will make free radius working slowly or not
I hope I explained my problem clearly
0
<Details>
    <Levels>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>0</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>1</MAT>
            <SDV>1</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>1</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>2</MAT>
            <SDV>2</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>2</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>1</MAT>
            <SDV>3</SDV>
            <Questions>
                <QuestionId>1209</QuestionId>
                <QuestionId>1210</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>3</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>2</MAT>
            <SDV>1</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
                …
0
hi experts my code is like that check on table1 if textbox1.Text exist if yes go to table2 and check if textbox1.text exist and if textbox2.Text exist if they exist open the form if not insert them and open the form and if textbox1.text exist and textbox2.text doesn't exist close form

i wrote this :

MySqlConnection con = new MySqlConnection(connectionString);
            i = 0;
            con.Open();
            MySqlCommand cmd = con.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from informat where u_ser = '" + metroTextBox2.Text + "' ";
            cmd.ExecuteNonQuery();
            DataTable dt = new DataTable();
            MySqlDataAdapter da = new MySqlDataAdapter(cmd);
            da.Fill(dt);
            i = dt.Rows.Count;
            int userial = metroTextBox2.Text.Length;
            if (userial >= 5 || metroTextBox2.Text == null)
            {

                MySqlConnection conet = new MySqlConnection(connectionString);
                conet.Open();
                MySqlCommand cmsd = conet.CreateCommand();
                cmsd.CommandType = CommandType.Text;
                cmsd.CommandText = "select * from alred  where u_ser = '" + metroTextBox2.Text + "'and u_ip =  '" + textBox1.Text + "'";
                cmsd.ExecuteNonQuery();
                DataTable ddts = new DataTable();
                MySqlDataAdapter ddas = new MySqlDataAdapter(cmsd);
                ddas.Fill(ddts);

         

Open in new window

0
I Created a form submitting data in a MySQL database

Now I try to get the following done.

To fill automatically some of the fields depending on the values in a previous field.  

Example: i have 3 fields

Firstname: ......
LastName: ......
UserName: .....
address: ......

All information is known in the db so when typing in the FirstName the LastName and  Username should automatically come up and be filled.

Thanks
0
In our environment all other jobs runs just fine but two jobs fails with ERROR" executed as user : \sqlserver [SQLSTATE HY000] (Error 596) "  then it fails the Cluster with Error

Cluster resource 'DWHAOGRP01' of type 'SQL Server Availability Group' in clustered role 'DWHAOGRP01' failed.

Based on the failure policies for the resource and role, the cluster service may try to bring the resource online on this node or move the group to another node of the cluster and then restart it.  Check the resource and group state using Failover Cluster Manager or the Get-ClusterResource Windows PowerShell cmdlet.
i have been looking everywhere but couldnt find any answer - tried rebuilding indexes broken the replica for that particular DB and also changed the user which executing this job .

Noting worked , please Help !!!
0
I have a web page that is divided into different sections. Each section has to show different results. These results are gotten from the database and from two different tables. The sections are gotten from a different table whereas the names are gotten from another table using the section as a secondary key

This is the expected result from the database
Section A
1 Adam Smith
2 John Smitherine
3 Mart Michael

Section B
1 John Doe
2 Bill Moe
3 Jane Bo

Section C
1 Jerome Park
2 Billy Zark
3 Marto Bark


So I came up with this
$section = $connect->query("SELECT section FROM Main_Section ");
while ($row = $section->fetch_array(MYSQLI_BOTH))
{
    $section_name = $row["section"];
    $name_result = $connect->query("SELECT id, firstname, lastname FROM Names WHERE section ='".$section_name."'");       
          while ($row1 = $name_result->fetch_array(MYSQLI_BOTH))
      {      
        $first_name = $row1["firstname"];
      $id = $row1["id"];      
      $last_name = $row1["lastname"];       
      $name_data  .= '<div>'.$id.' <div><h3>'.$first_name.' '.$last_name.'</h3></div></a></div>';                
                           
    }
$grand_data .= '<div class="box"><div class="sub-box"><h2>'.$section_name.'</h2></div>'.$name_data .'</div>';
}



on the html, I post the data by using

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>My Title</title>
  <meta name="description" content="My description">
</head>

<body>
  <?=$grand_data ?>
</body>
</html>

Here's the …
0
I work in php and mysql. In the site i have a search box. For Example: when i putting a skills i get around 100 data i further refine by putting in another skills   and the 100 is reduces  to 75. from 75 i further reduces and this process goes on till i have around 10 or 15 data.

This is a my search form.

search-form.png
if u have any example or any link please give me and help me.
Thank You
0
Hi, I'm trying to set up a website template with OpenCart integrated on my hosting server. It gets to step 3 and when I submit it gives a blank page. I switched on error reporting and I get this:


Fatal error: Uncaught Exception: Error: Access denied for user 'flowers'@'%' to database '614'<br />Error No: 1044<br /> CREATE DATABASE IF NOT EXISTS `614` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; in /var/www/flowers.co.uk/www/html/system/library/db/mysqli.php:40 Stack trace: #0 /var/www/flowers.co.uk/www/html/system/library/db.php(16): DB\MySQLi->query('\nCREATE DATABAS...', Array) #1 /var/www/flowers.co.uk/www/html/install/model/install/install.php(26): DB->query('\nCREATE DATABAS...') #2 /var/www/flowers.co.uk/www/html/system/storage/modification/system/engine/loader.php(150): ModelInstallInstall->database(Array) #3 /var/www/flowers.co.uk/www/html/system/engine/proxy.php(13): Loader->{closure}(Array) #4 /var/www/flowers.co.uk/www/html/install/controller/install/step_3.php(11): Proxy->__call('database', Array) #5 /var/www/flowers.co.uk/www/html/system/storage/modification/system/engine/action.php(44): ControllerInstallStep3->index() #6 /var/www/flowers.co.uk/www/html/system/engine/front.php(34): Action->exe in /var/www/flowers.co.uk/www/html/system/library/db/mysqli.php on line 40

Any ideas on what's going on here would be appreciated.
0
Hi all,

please check this below link for reference
https://www.indiafilings.com/find-gst-rate

I want to make same search and browse page how to make please help.
0
Hi
I wrote this stored procedure, but keep getting the missing 'end' error on the update query and i am lost as to why. Below is the Sp.
Also i am trying to loop in a cursor and get new tables created with each loop with the macro and macrolocation variable names as it gets. Is the syntax correct?


create procedure macroselected(IN macrosel int)
begin
declare macroval varchar(100);
declare macrolocation varchar(100);
declare macroid int;

select macroname into macroval from macro where macro.idmacro=macrosel;
update orgdetails set macroselected = macrosel where id=1;  (here is the error message for missing 'end' showing)

declare macrocur cursor for
select locationid,location from location;
declare continue handler for not found
set done=1;

open macrocur;
read_loop:loop

fetch from macrocur into macroid,macrolocation;
if done then leave read_loop; end if;

create table macro_macrolocation(macroid int not null auto_increment,macroyear varchar(300),macrostatus varchar(300));

end loop read_loop;
close macrocur;

end
0
Hi,

I've a 30 MySQL table on a AES EC2 Instance that I want to import into DynamoDB.
Could someone help me with the process.

DDL Information


Create Table

CREATE TABLE `AUDIT_ACTIVITY_LOG` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ACTIVITY_ID` int(11) NOT NULL COMMENT 'Activity group id',
  `LOG_TIME` datetime NOT NULL COMMENT 'Logging time',
  `USER_ID` int(11) DEFAULT NULL COMMENT 'User who performed the task can be system performed task',
  `MG_ID` int(11) DEFAULT NULL COMMENT 'Merchant Group Id',
  `ACTIVITY_TEXT` text COMMENT 'Activity text should be populated form text',
  `IP_ADDRESS` varchar(50) DEFAULT NULL COMMENT 'Stores the ip address for the activity.',
  `REF_ID` int(11) DEFAULT '0' COMMENT 'The ref id to store some ids like order id or any other id to make search fast',
  PRIMARY KEY (`ID`,`LOG_TIME`),
  KEY `idx_LOG_TIME` (`LOG_TIME`),
  KEY `idx_ACTIVITY_ID` (`ACTIVITY_ID`),
  KEY `idx_REF_ID` (`REF_ID`),
  KEY `idx_MG_ID` (`MG_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=54920993 DEFAULT CHARSET=utf8
/*!50100 PARTITION BY RANGE (YEAR(LOG_TIME))
SUBPARTITION BY HASH (MONTH(LOG_TIME))
SUBPARTITIONS 12
(PARTITION p2012 VALUES LESS THAN (2012) ENGINE = InnoDB,
 PARTITION p2013 VALUES LESS THAN (2013) ENGINE = InnoDB,
 PARTITION p2014 VALUES LESS THAN (2014) ENGINE = InnoDB,
 PARTITION p2015 VALUES LESS THAN (2015) ENGINE = InnoDB,
 PARTITION p2016 VALUES LESS THAN (2016) ENGINE = InnoDB,
 PARTITION p2017 VALUES LESS THAN (2017) …
0
Long Title, but that is exactly what I am trying to do.

I need a php script that will insert all of the inputs to a mysql table, I have tried to make one using a variety of methods, but none have worked, or they would insert the last value into the table.


Currently I have this HTML code:
		<table id="register">
		<form action="processing_games.php" method="post"/>
		<tr>
			<td><p>Date<br>(m/dd/yy)</p></td>
			<td><p>Time<br>(h:mm AM/PM)</p></td>
			<td><p>Opponent</p></td>
			<td><p>Location<br>(Rink Name)</p></td>
			<td><p>Conference<br>Game?</p></td>
			<td><p>Home or Away<br>Game?</p></td>
		</tr>
		<tr>
			<td><input type="date" name="inputs[0][date]"></td>
			<td><input type="time" name="inputs[0][time]"></td>
			<td><input type="text" name="inputs[0][opponent]"></td>
			<td><input type="text" name="inputs[0][location]"></td>
			<td><input type="radio" name="inputs[0][conference]" value="+"> Conference
			<br>
			<input type="radio" name="inputs[0][conference]" value=""> Non-Conference </td>
			<td><input type="radio" name="inputs[0][home_away]" value=" vs "> Home
			<br>
			<input type="radio" name="inputs[0][home_away]" value=" @ "> Away</td>
		</tr>
		<tr>
			<td><input type="date" name="inputs[1][date]"></td>
			<td><input type="time" name="inputs[1][time]"></td>
			<td><input type="text" name="inputs[1][opponent]"></td>
			<td><input type="text" name="inputs[1][location]"></td>
			<td><input type="radio" name="inputs[1][conference]" value="+"> 

Open in new window

0
I am trying to create a System where Users can book a time-slot(per day 3 bookings/hour) in a any given date and then that slot should fade away and other users won't be able to book that slot and it should show 'Booked'. After that users as well as the Company CEO should get the message that the slot has been booked with user name, date, time and purpose of Visit. How to do this using PHP and MySQL. Please help.
0
I created a database,  split it, and then I imported the tables to MYSQL. How do I connect the frontend of my db to the MYSQL backend?
0
I'm trying to import tables from my Access database, I was actually successful at importing one table, but since haven't been able to import anything. I'm using the same data source and I can see the tables but they won't import to the MySQL database I selected.
0
I need help creating custom fields within the ''ADD A NEW COURSE" page in moodle. I then need to build a report (SQL) to display all that information which then needs to be exported out into excel. I am currently using Configurable Reports
0
I did tutorial located here:, what i would like to do is add edit functionality, i would like to have an edit button and be able to edit record, the tutorial did no cover this, i have researched but i just cant wrap my head around it, i am new to codeigniter as you can tell.

here is my controller:
<?php

class Site extends CI_Controller
{

	function index()
	{

		$data = array();
		
		if($query = $this->site_model->get_records())
		{
			$data['records'] = $query;
		} 
		//$this->load->library('table');
		$this->load->view('options_view',$data);
	}

	function create()
	{
		$data = array(
			'title' => $this->input->post('title'),
			'content' => $this->input->post('content')
			);

		$this->site_model->add_record($data);		
		$this->index();
	}

	function update()
	{
		$data = array (
			'title' => 'My NEW UPDATED title',
			'content' => 'NEW UPDATED content; UPDATED'
			);
		$this->site_model->update_record($data);
	}

	

	 function delete()
	 {
	 	$this->site_model->delete_row();
	 	$this->index();
	 }

}

?>

Open in new window


Here is my model:
<?php

class Site_model extends CI_Model {

	function get_records()
	{
		 $query = $this->db->get('assets');
		 return $query->result();
		// $query = $this->db->query('SELECT * FROM assets');
	    //echo $this->table->generate($query);

	}


	function add_record($data)
	{
		$this->db->insert('assets', $data);
		return;
	}

	function update_record($data)
	{
		$this->db->where('id', 3);
		$this->db->update('assets', $data);
	}


	 function delete_row()
       {
	  	$this->db->where('id', $this->uri->segment(3));
	  	$this->db->delete('assets');

	   }


}

Open in new window


Here is my view:

Open in new window

0
please i'm trying to access phpmyadmin in my web browser but the page can't open
h.png please how do i solve this problem
0
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
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
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
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

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.