title: How to change default character set of database
body: <p>SO has the same question '<a href="https://stackoverflow.com/questions/7028610/mysql-change-default-table-charset-to-database-charset">mysql change default table charset to database charset</a>' asked before .I used the second answer to change my database default character set to utf-8 .</p>
  
  <pre><code>alter database mydatabase default character set utf8 collate utf8_general_ci;
  </code></pre>
  
  <p>But when I exported the database using <code>phpMyAdmin</code> ,though at the top I have</p>
  
  <pre><code>/*!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 */;
  </code></pre>
  
  <p>but for queries I have something like</p>
  
  <pre><code>--
  -- Table structure for table `paras`
  --
  
  CREATE TABLE IF NOT EXISTS `paras` (
    `p_id` int(11) NOT NULL AUTO_INCREMENT,
    `para` text,
    PRIMARY KEY (`p_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  </code></pre>
  
  <p>where <code>charset=latin1</code> .IMO it shouid be set to <code>UTF-8</code>.Am I confusing something or what is the correct way?</p>