executing a sql-statement on a mysql-server fails every-time - with demo
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
executing a sql-statement on a mysql-server fails every-time - with demo
first of all - i am not sure if this question is posted in the right forum
i have server - and on this server (which is adminstrated by a friend of me) :: i want to install a software on this server
therefore i have to add a sql file onto the server-db
in earlier times i was running phpmyadmin on the server.
now we have webmin - and i am fairliy new to webmin
i want to include a db into the db that i have had created.
question: how to do that - with webmin -
if i add a little snipped - nothing happens - no table were being created.
i have no glue why
is it a permission issue - or what?
Quote:
-- phpMyAdmin SQL Dump
-- version 4.1.9
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Apr 14, 2014 at 09:51 AM
-- Server version: 5.5.34
-- PHP Version: 5.5.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
CREATE TABLE `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`var_name` varchar(32) NOT NULL,
`title` text NOT NULL,
`description` text NOT NULL,
`keywords` text NOT NULL,
`category_order` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `category_order` (`category_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='programming/design/admin/etc.' AUTO_INCREMENT=15 ;
Output from SQL command CREATE TABLE `admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(16) NOT NULL,
`password` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- --
Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `username`, `password`) VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3'); --
-------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories`
( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL, `var_name` varchar(32) NOT NULL, `title` text NOT NULL, `description` text
NOT NULL, `keywords` text NOT NULL, `category_order` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `category_order` (`category_order`) )
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='programming/design/admin/etc.' AUTO_INCREMENT=15
i have no glue why the executing of an sql-statement fains on the webmin
love to hear from you
update
found some more issues - and error messages
if i try to upload the sql-file from the local machine then i get bck the statement below..
what does tis mean?
Quote:
Module Index Execute SQL
Output from uploaded SQL commands ..
ERROR 1064 (42000) at line 613: 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 '38214dc58d7791d92eb96a0a9b2703c80ec38dd922b9a7909ebe1e6437355ede72f8854641287bac' at line 49
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
It means that there is an error in the SQL command...
Let's dissect...
Help me/us here, edit the post and put the SQL statements in code tags, the quote tags are very helpful, but are not meant to convey code as such
let me try to execute the command on my server here, if I may.
Thor
Edit
Code:
CREATE TABLE `admin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(16) NOT NULL,`password` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2
works nicely...using PHPMyAdmin...
Second edit :
Code:
CREATE TABLE `categories`
( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL, `var_name` varchar(32) NOT NULL, `title` text NOT NULL, `description` text
NOT NULL, `keywords` text NOT NULL, `category_order` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `category_order` (`category_order`) )
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='programming/design/admin/etc.' AUTO_INCREMENT=15
Umm...works great too...
I'm confused...
Last edited by ButterflyMelissa; 08-30-2015 at 09:59 AM.
btw: they want to know the Port
>
>
> // mysql credentials
> 'db_host' => 'localhost',
> 'db_port' => 3306,
> 'db_user' => 'root',
> 'db_password' => '',
>
> ist die 3306 korrekt?
well we do not have SQL over TCP here! we use UNIX-Socket.
this : /home/vhost/WWW/var/run/mysql/mysql.sock
well this might be another story - but what should i add here in the congiguration file
Shouldn't you guys google for some MySql-quickstart-tutorial?
LOL, yea, there is an idea...I hope OP has done that...
I just got triggered by the SQL error that was displayed. I tested the SQL and it works.
Quote:
/home/vhost/WWW/var/run/mysql/mysql.sock
@ OP - this worries me. should that be in the home folder?
Quote:
well i struggle with the webmin
as far as I can see, webmin is web based, my thought is that it cannot have an impact...
because...the SQL you posted does work. Is it possible to see line 613, where the error DOES seem to happen? Mostly a quote, a comma or something small is missing...
Thor
within the configuration the db port is metioned .
>
>
> // mysql credentials
> 'db_host' => 'localhost',
> 'db_port' => 3306,
> 'db_user' => 'root',
> 'db_password' => '',
my server admin told me that SQL did not run over TCP - here. we allway used and will use
UNIX-Socket
No, this is not a port, a number is required here...if this setup was not altered (too much) the original port still is 3306...
Of course, I use mySQL completely different. I did a port scan and this port is not open, but...I approach the data via my own components...I have no need to open a port outside anyway...
Thor
Good to hear
Mark the thread as solved after you posted the solution that worked for you...for the users in the future that may stuggle with a similar challenge
Thor
Good to hear
Mark the thread as solved after you posted the solution that worked for you...for the users in the future that may stuggle with a similar challenge
Thor
Good luck with that, Thor_2.0. Please see the OP's posting history.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.