[Novalug] further questions on learning MySQL on ubuntu
Bonnie Dalzell
bdalzell at qis.net
Thu Dec 16 19:23:16 EST 2010
On Thu, 16 Dec 2010, William Morse wrote:
Thanks for the information.
I have to admit that I find the official mysql documentation very
difficult to understand. And I once thought "man" pages were
undecipherable.
I look at a official mysql page read it, then I google for someone
else's tutorial on the subject where an example actually looks like
something a am trying to do.
> Regarding the default character set,
>
> The mysql manual implies that the default is set either through
> compiling or through a command-line switch at startup.
> http://dev.mysql.com/doc/refman/5.0/en/charset-server.html
>
>
> Another page suggests that you can use a configuration file to specify
> the server character set.
> http://dev.mysql.com/doc/refman/5.1/en/mysqld-option-tables.html
>
> And this page tells you where you might find configuration files:
> http://dev.mysql.com/doc/refman/5.1/en/option-files.html
>
> In practise, I have had not had great success using character sets
> effectively... :-(
This character set thing seems to be unneccessarily obscure. I would think
is would be a important feature and should be easily managed. At least if
I was writing a database engine I would try and make it simple to set
up :-)
My dog name database needs uft8 as many of the dogs are from Germany,
Sweden etc and have Euro vowels in their names.
>
>
>
> --
> William Morse
> Database Management
> American Councils for International Education: ACTR/ACCELS
> tel. 202-833-7522
>
> -----Original Message-----
> From: novalug-bounces at calypso.tux.org
> [mailto:novalug-bounces at calypso.tux.org] On Behalf Of Bonnie Dalzell
> Sent: Thursday, December 16, 2010 4:31 PM
> To: NOVALUG
> Subject: [Novalug] further questions on learning MySQL on ubuntu
>
>
> Supposedly MySQL supports foreign keys if you use the INNODB database.
>
> However my attempts to do a tutorial foreign key example have not been
> successful.
>
> Here is the result from the command line. The tutorial has me set up two
> tables, zoo and species. The foreign key will be in zoo.
>
> describe species;
> +-------+-------------+------+-----+---------+----------------+
> | Field | Type | Null | Key | Default | Extra |
> +-------+-------------+------+-----+---------+----------------+
> | id | int(11) | NO | PRI | NULL | auto_increment |
> | name | varchar(50) | NO | | NULL | |
> +-------+-------------+------+-----+---------+----------------+
>
> mysql> describe zoo
> -> ;
> +------------+-------------+------+-----+---------+----------------+
> | Field | Type | Null | Key | Default | Extra |
> +------------+-------------+------+-----+---------+----------------+
> | id | int(4) | NO | PRI | NULL | auto_increment |
> | name | varchar(50) | NO | | NULL | |
> | FK_species | tinyint(4) | NO | UNI | NULL | |
> +------------+-------------+------+-----+---------+----------------+
>
> when I try to add a foreign key - the syntax being from a tutorial
> - I get an error:
>
> mysql> alter table zoo add foreign key (FK_species) References species
> (id);
> ERROR 1005 (HY000): Can't create table 'test.#sql-592_237' (errno: 150)
>
> anyone have any insight into this?
>
> both zoo and the other table species are set as INNODB.
>
>
> also if anyone can tell me how to configure my MySQL installation so the
> default collation (character set) is either latin1_general_ci or
> utf8_general_ci rather than latin1_swedish_ci I would appreciate it. Why
> is latin1_swedish_ci the default when MySQL is installed? Was MySQL
> invented by a Swede?
>
>
> thanks.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Bonnie Dalzell, MA mail:5100 Hydes Rd PO Box 60,
> Hydes,MD,USA 21082-0060|EMAIL:bdalzell at qis.net Freelance anatomist,
> vertebrate paleontologist, writer, illustrator, dog breeder, computer
> nerd & iconoclast... Borzoi info at www.borzois.com.
> HOME www.batw.net ART bdalzellart.batw.net BUSINESS
> www.boardingatwedge.com
>
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bonnie Dalzell, MA
mail:5100 Hydes Rd PO Box 60, Hydes,MD,USA 21082-0060|EMAIL:bdalzell at qis.net
Freelance anatomist, vertebrate paleontologist, writer, illustrator, dog
breeder, computer nerd & iconoclast... Borzoi info at www.borzois.com.
HOME www.batw.net ART bdalzellart.batw.net BUSINESS www.boardingatwedge.com
More information about the Novalug
mailing list