dope2008

4451 经验值

        $post='xml字符串';
        $url = 'https://uat.manutouch.com.cn/alli_mcd_move/ws/moveClienteleService?wsdl';
        $client = new \SoapClient($url);
        $response = $client->saveClientele(['in0' => $post]);

老是返回Not enough message parts were received for the operation
但是java本身用,就是可以的,网上查是我传的参有问题。

production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'forge'' in /data/

你处理了吗?是怎么样的问题?

[2017-03-22 10:01:57] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'forge'' in /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:119
Stack trace:
#0 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(119): PDO->__construct('mysql:host=loca...', 'forge', '', Array)
#1 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(56): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=loca...', 'forge', '', Array)
#2 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#3 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(100): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#5 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(964): call_user_func(Object(Closure))
#6 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(832): Illuminate\Database\Connection->getPdo()
#7 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(717): Illuminate\Database\Connection->reconnectIfMissingConnection()
#8 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(350): Illuminate\Database\Connection->run('select * from `...', Array, Object(Closure))
#9 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1648): Illuminate\Database\Connection->select('select * from `...', Array, true)
#10 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1634): Illuminate\Database\Query\Builder->runSelect()
#11 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(629): Illuminate\Database\Query\Builder->get(Array)
#12 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(324): Illuminate\Database\Eloquent\Builder->getModels(Array)
#13 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(294): Illuminate\Database\Eloquent\Builder->get(Array)
#14 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(307): Illuminate\Database\Eloquent\Builder->first(Array)
#15 /data/www/infiniteSendV2/app/Http/Controllers/Api/TemplateController.php(12): Illuminate\Database\Eloquent\Builder->firstOrFail()
#16 [internal function]: App\Http\Controllers\Api\TemplateController->getShow('13', '343')
#17 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(55): call_user_func_array(Array, Array)
#18 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction('getShow', Array)
#19 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Route.php(190): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Api\TemplateController), 'getShow')
#20 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Route.php(144): Illuminate\Routing\Route->runController()
#21 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Router.php(642): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#22 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#23 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#24 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#27 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), '60', '1')
#28 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#29 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#30 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Router.php(644): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#31 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Router.php(618): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#32 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Router.php(596): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#33 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(267): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#34 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#35 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#36 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(137): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#39 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#40 /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#41 /data/www/infiniteSendV2/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#42 {main}  

这个只是有时候会这样,每天大约一次吧

production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'forge'' in /data/www/infiniteSendV2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:119
Stack trace:

可以我的配置文件一直没有动过。不知道是不是并发问题,我/config/database.php都修改了

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '121.40.**'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', '****'),
            'username' => env('DB_USERNAME', '***'),
            'password' => env('DB_PASSWORD', '***'),
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],

我有很多表,表名 a1,a2,a3,a4 表结构有一些不同。
但是都想用一个Model 如 A

我试过新增数据用

$add=[
    'name'=>'张三'
];
$model = new A($add);
$model->setTable('a1');
$model->save();

修改数据

$add=[
    'name'=>'张三'
];
$model = new A();
$model->setTable('a1');
$model->where('id', 1)->update($add);

但是做到队列表时候,就死了

$model = new A();
$model->setTable('a1');
$data=$model->where('id', 1)->first();
$job = (new ActivityRegistered($data));
dispatch($job);

/app/Jobs/ActivityRegistered.php

    public $data;

    public function __construct(A $data)
    {
        $this->data = $data;
    }

    public function handle()
    {
        \Log::info($this->data->id);
    }

这个就输不出来了,

Stack trace:

提示我a表没有,是因为我的Model是

class A extends Model
{
    protected $table = 'a';
    protected $guarded = ['id', 'created_at', 'updated_at', 'mobile_info'];//不能被批量赋值的属性
    protected $casts = [
        'mobile_info' => 'json',
        'visitors'    => 'json'
    ];
}

想问一下有什么思路来帮我做分表处理。

  • a1,a2,a3表常用model功能可以用

  • 可以使用队列

        Schema::create('abc', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('姓名');
            $table->string('email')->unique();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });

我能在控制器直接这样子写吗?如果我要用程序来建表,是怎么样建的?我试了一下,好象是报错的

php artisan make:request UserRequest

UserRequest文件随便写一条验证

他提示我This action is unauthorized.

curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
Detected macOS Sierra 10.12. All ok.
Get packager.tgz
Unpack packager.tgz
Please type in your password, as we want to install this into /usr/local
Password:
Start packager (may take some time)
downloading https://s3-eu-west-1.amazonaws.com/php-osx.liip.ch/install/7.1-10.10-frontenddev-latest.dat
downloading https://s3-eu-west-1.amazonaws.com/php-osx.liip.ch/install/7.1-10.10/frontenddev/7.1-10.10-frontenddev-7.1.0-20161202-092124.tar.bz2

到这里就不动了,几个小时都是一样