Search found 199 matches

by chris
Sun Sep 02, 2012 12:02 pm
Forum: MySQL
Topic: Solved: convert MySQL db from Latin1 to UTF8
Replies: 7
Views: 134466

Re: convert MySQL db from Latin1 to UTF8

You probably set default-character-set=utf8 Under [client] in /etc/mysql/my.cnf You also need to set it under [mysqld] ; Actually character-set-server=utf8 would be better. This should take care of the Server characterset . For your database you have to do some additional steps. in MySQL give the fo...
by chris
Thu Aug 30, 2012 3:30 pm
Forum: SQL
Topic: Set bit to TRUE/FALSE
Replies: 1
Views: 17867

Re: Set bit to TRUE/FALSE

You can use TININT(1) to set a value of 1 bit (0 or 1).

But my personal favorite is EMNUM

Code: Select all

valuename enum('true','false') NOT NULL default 'false'
note: ENUM can have more then 2 values, up to 65,535.
by chris
Wed Aug 22, 2012 3:52 pm
Forum: SQL
Topic: SQL count results from group by
Replies: 1
Views: 17647

Re: SQL count results from group by

There is a nice solution in MySQL. Add the keyword SQL_CALC_FOUND_ROWS right after the keyword SELECT : SELECT SQL_CALC_FOUND_ROWS table1.id, table2.name,table3.name FROM table1, table2, table3 WHERE (associate table1, table2 and table3 to each other) GROUP BY table1.id LIMIT 10,20 After that, run a...
by chris
Wed Aug 22, 2012 3:47 pm
Forum: Servers
Topic: Where does MySQL store it database files
Replies: 2
Views: 31782

Re: Where does MySQL store it database files

This is set by datadir in my.cf (/etc/mysql/my.cnf) in Linux,
or my.ini (C:\Program Files\MySQL\MySQL Server 5.1\my.ini) in Windows

Standard it is in Linux:
datadir = /var/lib/mysql

in Windows:
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"
by chris
Wed Aug 22, 2012 3:47 pm
Forum: MySQL
Topic: Where does MySQL store it database files
Replies: 2
Views: 24812

Re: Where does MySQL store it database files

This is set by datadir in my.cf (/etc/mysql/my.cnf) in Linux,
or my.ini (C:\Program Files\MySQL\MySQL Server 5.1\my.ini) in Windows

Standard it is in Linux:
datadir = /var/lib/mysql

in Windows:
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"
by chris
Thu Aug 16, 2012 9:05 am
Forum: PHP
Topic: Solved: How to open 2 mysql databases in php
Replies: 2
Views: 23258

Re: How to open 2 mysql databases in php

You can add a 4th parameter in mysql_connect, this will open a new separated connection. $dbconn1 = mysql_connect($hostname, $username, $password); $dconn2 = mysql_connect($hostname, $username, $password, true); mysql_select_db('database1', $dbconn1); mysql_select_db('database2', $dbconn2); $result1...
by chris
Mon Jun 18, 2012 11:25 am
Forum: HTML
Topic: max width of a table
Replies: 1
Views: 23741

Re: max width of a table

you can use max-width in css. for example you can use the following class: .bigtable{max-width:1024px;valign:top;margin-left: auto;margin-right: auto} max-width:1024px : The maximum size of your table will be 1024 pixels. valign:top : position of the table margin-left: auto;margin-right: auto : it c...
by chris
Sun Apr 15, 2012 10:01 pm
Forum: Apache
Topic: kubuntu stop apache from starting automatically
Replies: 1
Views: 25622

Re: kubuntu stop apache from starting automatically

You can use update-rc.d

Code: Select all

update-rc.d apache2 disable
The remove will completely remove the startup files,
you don't want that.

Code: Select all

update-rc.d -f apache2 remove
Hope this is what you are looking for.
by chris
Mon Apr 09, 2012 11:03 am
Forum: Apache
Topic: Solved: ssl not working on apache
Replies: 2
Views: 26645

Re: ssl not working on apache

Usually it means there are still some settings wrong with your apache configuration. Make sure all the port is set : Listen 10443 But also NameVirtualHost *:10443 and <VirtualHost *:10443> you can find the settings in /etc/apache2/httpd.conf or for virtual hosts /etc/apache2/vhosts.d/0x_yoursite.con...
by chris
Tue Mar 20, 2012 7:29 pm
Forum: Servers
Topic: Solved: How do I let a service start at boot on CentOS
Replies: 2
Views: 31756

Re: How do I let a service start at boot on CentOS

You can do this with the builtin chkconfig utility: sudo /sbin/chkconfig --list This command show you all the services and their status on each runlevel. If you don't see your service in it (mysqld for example?), you can add it. sudo /sbin/chkconfig --add mysqld You also need to set it to ON, in the...