Skip to main content

Posts

How To Import and Export Databases and Reset a Root Password in MySQL

How to Import and Export Databases Export To Export a database, open up terminal, making sure that you are not logged into MySQL and type, mysqldump -u [username] -p [database name] > [database name].sql The database that you selected in the command will now be exported to your droplet. Import To import a database, first create a new blank database in the MySQL shell to serve as a destination for your data. CREATE DATABASE newdatabase; Then log out of the MySQL shell and type the following on the command line: mysql -u [username] -p newdatabase < [database name].sql With that, your chosen database has been imported into your destination database in MySQL. How to Reset a Root Password When you first install MySQL, you have to set up your root password. However, should you forget it at any point, you can still recover it. Step One—Shut Down MySQL In terminal, stop the MySQL process /etc/init.d/mysql stop Step Two—Access MySQL Safe Mode In safe mod

How to add ignore folder and file in svn.?

Goto folder on file location which one you want to ingnore i suppose you have access of svn repo means you have set user name and pass. in svn then example show that upload folder in ignore in svn commit see there is .(dot) also. svn propset svn:ignore upload/ .

Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler

Install Solr download and install Solr from  http://lucene.apache.org/solr/ . you can access Solr admin from your browser: http://localhost:8983/solr/ use the port number used in installation. MySQL connector Download JDBC driver for MySQL from  http://dev.mysql.com/downloads/connector/j/ . Copy file from the downloaded archive 'mysql-connector-java-*.jar' to the folder 'contrib/dataimporthandler/lib' in the folder where Solr was installed. Create 'lib' folder if needed. MS SQL Server connector Download Microsoft JDBC Driver 4.0 for SQL Server from:  http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774 copy file 'sqljdbc4.jar' to 'contrib/dataimporthandler/lib' Setup a new collection create a new folder for a new collection - 'myproducts'. The collection will be located in '/solr/myproducts' folder. Create folders conf and data in the collection folder: /solr/myproducts/conf /

How to configure zf2 and doctrine2 ?

Step-1 : install zf2 developer tool  php composer.pharrequire zendframework/zend-developer-tools:dev-master Step-2: add in application config/application.config.php 'modules' => array( 'ZendDeveloperTools', 'DoctrineModule', 'DoctrineORMModule', 'Application', ), Step-3: Create your entity module/Application/src/Application/Entity/User namespace Application\Entity; use Doctrine\ORM\Mapping as ORM; /** @ORM\Entity */ class User { /** * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ protected $id; /** @ORM\Column(type="string") */ protected $fullName; // getters/setters } Step-4: do mapping in module/Application/config/module.config.php 'doctrine' => array( 'driver' => array( 'application_entities' => array( 'class' =>'Doctrine\ORM

How to create navigation in ZF2 with partial template

Step -1 : Create partial template location : Application/view/partial/navigation.phtml in navigation.phtml file put your custome html  code. like <ul class="sidebar-menu"> <li class="header">MAIN NAVIGATION</li> <?php $count = 0 ?> <?php foreach ($this->container as $page): ?> <?php /* @var $page Zend\Navigation\Page\Mvc */ ?> <?php // when using partials we need to manually check for ACL conditions ?> <?php if( ! $page->isVisible() || !$this->navigation()->accept($page)) continue; ?> <?php $hasChildren = $page->hasPages() ?> <?php if( ! $hasChildren): ?> <li <?php if($page->isActive()) echo 'class="active treeview"'?>> <a class="nav-header" href="<?php echo $page->getHref() ?>"> <i class="fa fa-dashboard"></i><span> <?php echo $this->translate

How to change layout of zfcUser for login and registration ?

in modul.php public function onBootstrap(MvcEvent $e) { $eventManager = $e->getApplication()->getEventManager(); $moduleRouteListener = new ModuleRouteListener(); $moduleRouteListener->attach($eventManager); $application = $e->getTarget(); $sm = $application->getServiceManager(); $auth = $sm->get('zfcuser_auth_service'); if (!$auth->hasIdentity()) { $eventManager = $e->getApplication()->getEventManager(); $eventManager->attach(MvcEvent::EVENT_DISPATCH, function($e) { $vm = $e->getViewModel(); $vm->setTemplate('layout/layout-cutome'); }); } }