473,732 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AW: mutual declarations produce Error 1064

Hello programmers,
I think something is wrong with my administration,

Basically I get these messages,

ERROR 1005 at line 9: Can't create table '.\company\depa rtment.frm'
(errno: 150)

ERROR 1045: Access denied for user: 'e******@127.0. 0.1' (Using password:
YES)

ERROR 1133: Can't find any matching row in the user table

C:\mysql\exampl es\elmasri>mysq l -u root -p*******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 4.1.0-alpha-max-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Database changed
mysql> update user set password =3D password('navat he') where user =3D
'elmasri';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

mysql> quit
Bye

C:\mysql\exampl es\elmasri>mysq l -u elmasri -pnavathe company
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17 to server version: 4.1.0-alpha-max-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye

C:\mysql\exampl es\elmasri>mysq l -u elmasri -pnavathe company <
company_01.sql
ERROR 1005 at line 9: Can't create table '.\company\depa rtment.frm'
(errno: 150)
C:\mysql\exampl es\elmasri>
C:\mysql\exampl es\elmasri>type company_01.sql
# mysql -u root -h localhost -p -vvv < company_01.sql

USE company;

# SHOW INNODB STATUS;

DROP TABLE IF EXISTS DEPARTMENT;

CREATE TABLE DEPARTMENT
(
DNAME VARCHAR(15) NOT NULL,
DNUMBER INT NOT NULL,
MGRSSN CHAR(9) NOT NULL,
MGRSTARTDATE DATE,

PRIMARY KEY (DNUMBER),
UNIQUE (DNAME),

INDEX (MGRSSN), # between employee and department
FOREIGN KEY (MGRSSN) # a sort of mutually declaration
REFERENCES EMPLOYEE(SSN) # this is declared in employee

)TYPE =3D INNODB;
DROP TABLE IF EXISTS EMPLOYEE;

CREATE TABLE EMPLOYEE
(
FNAME VARCHAR(15) NOT NULL,
MINIT CHAR,
LNAME VARCHAR(15) NOT NULL,
SSN CHAR(9) NOT NULL,
BDATE DATE,
ADDRESS VARCHAR(30),
SEX CHAR,
SALARY DECIMAL(10,2),
SUPERSSN CHAR(9),
DNO INT NOT NULL,

PRIMARY KEY (SSN),
INDEX (SUPERSSN, SSN),

FOREIGN KEY (SUPERSSN)
REFERENCES EMPLOYEE(SSN),

INDEX (DNO, DNUMBER),
FOREIGN KEY (DNO)
REFERENCES DEPARTMENT(DNUM BER) # this is declared in department
)TYPE =3D INNODB;
C:\mysql\exampl es\elmasri>mysq l -u root -p*******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19 to server version: 4.1.0-alpha-max-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> grant all on company.* to 'elmasri'@'loca lhost' identified by
'navathe';
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

C:\mysql\exampl es\elmasri>mysq l -u elmasri -pnavathe company;
ERROR 1045: Access denied for user: 'e******@127.0. 0.1' (Using password:
YES)

C:\mysql\exampl es\elmasri>mysq l -u root -p*******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21 to server version: 4.1.0-alpha-max-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set password for 'elmasri'@'loca lhost' =3D password('navat he');
Query OK, 0 rows affected (0.00 sec)

mysql> set password for 'elmasri'@'%' =3D password('navat he');
ERROR 1133: Can't find any matching row in the user table
mysql>

=3D=3D=3D

what can we do now ?
I try again with=20
Manually

mysql> create table employee( fname varchar(15) )type=3Dinnodb;
Query OK, 0 rows affected (0.00 sec)

mysql> DROP TABLE IF EXISTS EMPLOYEE;
Query OK, 0 rows affected (0.00 sec)

And=20
mysql> CREATE TABLE EMPLOYEE
-> (
-> FNAME VARCHAR(15) NOT NULL,
-> MINIT CHAR,
-> LNAME VARCHAR(15) NOT NULL,
-> SSN CHAR(9) NOT NULL,
-> BDATE DATE,
-> ADDRESS VARCHAR(30),
-> SEX CHAR,
-> SALARY DECIMAL(10,2),
-> SUPERSSN CHAR(9),
-> DNO INT NOT NULL,
->
-> PRIMARY KEY (SSN),
-> INDEX (SUPERSSN, SSN),
->
-> FOREIGN KEY (SUPERSSN)
-> REFERENCES EMPLOYEE(SSN),
->
-> INDEX (DNO, DNUMBER),
-> FOREIGN KEY (DNO)
-> REFERENCES DEPARTMENT(DNUM BER) # this is declared in department
-> )TYPE =3D INNODB;
ERROR 1072: Key column 'DNUMBER' doesn't exist in table
mysql> create table employee( fname varchar(15) )type=3Dinnodb;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> CREATE TABLE EMPLOYEE
-> (
-> FNAME VARCHAR(15) NOT NULL,
-> MINIT CHAR,
-> LNAME VARCHAR(15) NOT NULL,
-> SSN CHAR(9) NOT NULL,
-> BDATE DATE,
-> ADDRESS VARCHAR(30),
-> SEX CHAR,
-> SALARY DECIMAL(10,2),
-> SUPERSSN CHAR(9),
-> DNO INT NOT NULL,
->
-> PRIMARY KEY (SSN),
-> INDEX (SUPERSSN, SSN),
->
-> FOREIGN KEY (SUPERSSN)
-> REFERENCES EMPLOYEE(SSN),
->
-> INDEX (DNO),
-> FOREIGN KEY (DNO)
-> REFERENCES DEPARTMENT(DNUM BER) # this is declared in department
-> )TYPE =3D INNODB;
ERROR 1005: Can't create table '.\company\empl oyee.frm' (errno: 150)
mysql> exit
Bye

C:\mysql\exampl es\elmasri>mysq l -u elmasri -pnavathe company <
company_01.sql
ERROR 1005 at line 9: Can't create table '.\company\depa rtment.frm'
(errno: 150)

This shows that I actually can create a table,

My question is now,

Is this code ansi sql correct ?

How can I Modify it to run under the latest MySQL ?

Is it something wrong with the users I have created ?

I expect one user and one password for entering mysql,
And depending upon which database I'd like to use=20
I expect for each database I'd like to use, one second password,

This seems to be another topic,
When I write=20

mysql> grant all on company.* to 'elmasri'@'loca lhost' identified by
'navathe';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on company.* to 'elmasri'@'%' identified by 'navathe';
Query OK, 0 rows affected (0.00 sec)

mysql>

Then I should be able to do whatever SQL permits ?

Yours sincerely

Morten Gulbrandsen

-----Urspr=FCngliche Nachricht-----
Von: Victoria Reznichenko [mailto:vi****** ************@en sita.net]=20
Gesendet: Donnerstag, 7. August 2003 13:54
An: my***@lists.mys ql.com
Betreff: Re: mutual declarations produce Error 1064

"Morten Gulbrandsen" <mg*@owi-aachen.de> wrote:
USE company;
=20
# SHOW INNODB STATUS;
=20
DROP TABLE IF EXISTS DEPARTMENT;
=20
CREATE TABLE DEPARTMENT
(
DNAME VARCHAR(15) NOT NULL,
DNUMBER INT NOT NULL,
MGRSSN CHAR(9) NOT NULL,
MGRSTARTDATE DATE,
=20
PRIMARY KEY (DNUMBER),
UNIQUE (DNAME),
=20
INDEX (MGRSSN), # between employee and department
FOREIGN KEY (MGRSSN), # a sort of mutually declaration=20
REFERENCES EMPLOYEE(SSN) # this is declared in employee


Remove comma before REFERENCES.

--=20
For technical support contracts, goto
https://order.mysql.com/?ref=3Densita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ Vi************* *****@ensita.ne t
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com

--=20
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: =
http://lists.mysql.com/mysql?unsub=3Dmg*@owi-aachen.de
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 5086

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2981
by: Kenneth Illingsworth | last post by:
--=_603E7359.5B3A569C Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I suspect that this is some kind of issue with privileges. However, the = account I am using has been given 'ALL' privileges to the database I am = trying to insert to. Am I save to assume that ALL includes insert = privileges?
0
1523
by: Ola Ogunneye | last post by:
--=_104E0413.12733F99 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I am running mysql 4.0.13 and using a weblog(Geeklog) to do my web. Using geeklog as been okay until I tried creating moderators to my forum and then I got the following error: 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
0
2808
by: Ola Ogunneye | last post by:
--=_075912CF.F899D547 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello again all, I have created an account in the particular database that I was trying to backup Using PHPMYADMIN and I also created the same user account on the OS side. I still got the same 1064 message afterwards. I am still relatively new to Mysql and my adding user only works when I use
0
1437
by: Morten Gulbrandsen | last post by:
USE company; # SHOW INNODB STATUS; DROP TABLE IF EXISTS DEPARTMENT; CREATE TABLE DEPARTMENT ( DNAME VARCHAR(15) NOT NULL, DNUMBER INT NOT NULL,
0
1193
by: Morten Gulbrandsen | last post by:
C:\mysql\bin>mysql -u elmasri -pnavathe company Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 4.1.0-alpha-max-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> select database(); +------------+ | database() | +------------+
0
3042
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
3
4494
by: pyramus | last post by:
I am wondering which one should be preferred for creating a local synonym within a function definition. Let's say I have a type in my library called MyLib::Foundation::int32, which I can't stand typing all the time. Should I do: void foo() { typedef MyLib::Foundation::int32 int32; int32 x = 0; }
14
2200
by: aaragon | last post by:
Hi everyone, I've been writing some code and so far I have all the code written in the .h files in order to avoid the linker errors. I'm using templates. I wanted to move the implementations to the .cpp files. After some reading, I found that the only way to do this is to add the actual template instantiations in the .cpp file. But, how do you do that if you're not working with built-in types? For example, a template class might be,
3
2930
by: dipperdan | last post by:
Hi, I'm getting an error 1064 when trying to delete some rows from a table. SQL is: DELETE FROM images WHERE image_id = 803 AND plant_num = 2277 LIMIT 1; DELETE FROM images WHERE image_id = 804 AND plant_num = 2277 LIMIT 1; DELETE FROM images WHERE image_id = 805 AND plant_num = 2277 LIMIT 1;
2
4312
by: amaddox | last post by:
When I run this query from PHPMyAdmin, it works: DELETE FROM `tbl_user_link` WHERE ((`ulUserID`!=3 AND `ulConnectID`! =1) AND (`ulUserID`!=18 AND `ulConnectID`!=23)) AND `ulTypeID`=10 AND `ulOtherID`=160 However, when I run it from my application, I get a MySQL error 1064. Any ideas?
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.